Explanation of list reference

Chris Angelico rosuav at gmail.com
Sun Feb 16 20:26:38 EST 2014


On Mon, Feb 17, 2014 at 10:46 AM, Roy Smith <roy at panix.com> wrote:
>> References aren't themselves objects. Names, attributes, etc, etc,
>> etc, all refer to objects. Is it clearer to use the verb "refer"
>> rather than the noun "reference"?
>>
>> ChrisA
>
> I know functions are objects, but what about statements?  Is the body of
> a for loop an object?  It is in some languages.

And *that* is an extremely fair question. The best explanation I can
come up with is somewhat circular: If it can be named in the code,
it's an object. What that really means is that every object is
first-class (contrast, for instance, C's arrays and functions), but it
doesn't answer the actual question of what's an object and what's not.
But my advice would be to try things in the interactive interpreter.

ChrisA



More information about the Python-list mailing list