Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:28:53+00:00 2026-06-13T05:28:53+00:00

Does the object keyword have any uses except for classes like: class HelloWorld(object): pass

  • 0

Does the object keyword have any uses except for classes like:

class HelloWorld(object):
    pass

Because when assigning a variable to object it seems as if there is no use for it (no variable.__dict__ or anything).

for example:

x=object()
x.anything="foo"#<----- throws an error
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:28:55+00:00Added an answer on June 13, 2026 at 5:28 am

    One possible use is for sentinel values – things that you want to have unique values that can’t be duplicated by accident. For instance:

    NOT_SET = object()
    
    def some_function(arg=NOT_SET):
        if arg is NOT_SET:
            # the user didn't pass in a value for 'arg'
         else:
            # the user passed in a value for 'arg'
    

    Because every object instance has a unique identity, the if statement’s condition will only be true if the user didn’t pass in a value (unlike the common default value for a parameter, None, which the user might pass in to some functions).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What does 'this' keyword refer to when used in global object? Let's say for
When you serialized an object does it follow pointers. Let say I have a
I'm trying to port some windowss MFC class to linux because I have to
If you have class and a constructor which takes in an object as a
Possible Duplicates: Why use ref keyword when passing an Object? When to pass ref
Possible Duplicate: Why are singleton objects more object orientated? Why does Scala have language
I have a span tag that looks like the following: <span class=myClass>Lorem ipsum</span> I
In Ruby (1.8.X) Why does Object both inherit off Kernel and include it? Wouldn't
Initialising the Foo object does run the method func(), but the value of self.a
I am creating a flash object that does some heavy image lifting. What I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.