Relationship between ‘object’ and the name of an object (was: Which part of the loop is it going through in this class frame?)

Ben Finney ben+python at benfinney.id.au
Thu Mar 8 20:47:18 EST 2018


C W <tmrsg11 at gmail.com> writes:

> A follow-up question:

(When you want to switch the discussion to a different subject, please
indicate that by changing the Subject field in your message.

I am not really clear on what you're asking, so I have guessed and made
a subject that I think summarises what you mean.)

> How did the value of "object" get passed to "time"? Obviously, they
> have different names. How did Python make that connection?

In the context of your original question, I think this one reveals that
you are missing some fundamental knowledge of how Python treats objects
and references.

Every object has a type. Types are themselves objects; the most basic
type, in Python, is named ‘object’.

Yes, already this makes it somewhat difficult to discuss these concepts
:-)

You will probably benefit greatly by reading and watching this
presentation by Ned Batchelder, that walks you through some common
minuderstandings, and replaces them with correct concepts for how Python
treats objects and references.

    Facts and Myths about Names and Values
    <URL:https://nedbatchelder.com/text/names1.html>

-- 
 \           “If you ever fall off the Sears Tower, just go real limp, |
  `\     because maybe you'll look like a dummy and people will try to |
_o__)                catch you because, hey, free dummy.” —Jack Handey |
Ben Finney




More information about the Python-list mailing list