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

  • SEARCH
  • Home
  • 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 7741625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:04:26+00:00 2026-06-01T09:04:26+00:00

(In regards to Python 3.2) I’m trying to make a statement along the lines

  • 0

(In regards to Python 3.2)

I’m trying to make a statement along the lines of:

In Python, an object is…

According to the doc (http://docs.python.org/py3k/reference/datamodel.html#objects-values-and-types):

Every object has an identity, a type and a value

But where do attributes fall into that? If I do something like a = 3; print(a.__class__) I get <class 'int'> I assume that is the type of the object a references, meaning that "type" is an "attribute" of an object. So in that sense we can say a sufficient set of "things" an object has would be its identity, value and attributes. However, looking through the attributes of a using dir(a), I do not see anything resembling identity (even though I know the id() function will tell me that information).

So my question is are any of the following minimal statements to sufficiently describe the notion of a Python object?

  1. In Python an object has attributes, of which always include an identity, type and value.

  2. In Python an object has an identity and attributes, of which always include its type and value.

  3. In Python an object has an identity, value and attributes, of which always include its type, among other things.

If not, could someone give me a definition that conveys the relationships attributes, identity, type and value for an object?

(I would prefer number 1 to be true. :P)

  • 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-01T09:04:27+00:00Added an answer on June 1, 2026 at 9:04 am

    While you can access the type of an object through an attribute, its type isn’t just an attribute — the type defines how the object was created before it had any attributes at all. By that fact alone none of those statements is sufficient to describe a Python object.

    I’d say it this way:

    In Python, everything is an object.

    An object is a block of information, which has a type, which defines its creation and how it interacts with other objects, an identity, which differentiates it from all other objects, and a value, which is the information in the block. Attributes are other objects associated with a given object, including the object that is its type.

    You should then give some examples of things people might not expect to be objects, like functions.

    A paragraph on "What is an object" can be found in Dive Into Python:

    Everything in Python is an object, and almost everything has attributes and methods. All functions have a built-in attribute __doc__, which returns the doc string defined in the function’s source code. The sys module is an object which has (among other things) an attribute called path. And so forth.

    Still, this begs the question. What is an object? Different programming languages define “object” in different ways. In some, it means that all objects must have attributes and methods; in others, it means that all objects are subclassable. In Python, the definition is looser; some objects have neither attributes nor methods (more on this in Chapter 3), and not all objects are subclassable (more on this in Chapter 5). But everything is an object in the sense that it can be assigned to a variable or passed as an argument to a function (more in this in Chapter 4).

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

Sidebar

Related Questions

I am reading this http://docs.python.org/dev/library/multiprocessing.html In particular this p = multiprocessing.Process(target=time.sleep, args=(1000,)) I tried
Regards, SO I am new to python and Perl. I have been trying to
What is the current status of easy_install, pip and the repository (pypi.python.org) with regards
In regards to: Find Hyperlinks in Text using Python (twitter related) How can I
With regards to the following statement: SELECT * FROM explorer.booking_record booking_record_ INNER JOIN explorer.client
I was wondering how to make a python script portable to both linux and
Relatively new to python. I recently posted a question in regards to validating that
I was recently teaching myself Python and discovered the LBYL/EAFP idioms with regards to
I am very new to Python and I have been trying to detect missing
I am new to PYTHON and trying to write script which replaces text in

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.