Origin of the term "first-class object"

Ben Finney bignose-hates-spam at and-benfinney-does-too.id.au
Mon Nov 17 18:38:20 EST 2003


On Mon, 17 Nov 2003 23:18:52 GMT, Rainer Deyke wrote:
> John Roth wrote:
>> there are no second class citizens in Python...
>
> I would consider variables to be second-class citizens.  You can
> change their value, delete them, and get at the object to which they
> refer, but you can't do much else with them.

AIUI, there are no "variables" in Python; or rather, the normal usage of
that term is not precise enough in Python, since the task is split.
There are names bound to objects.

Objects are all first-class.

Names are essentually a language device used to refer to an object.  You
don't "change their value"; you change the object to which they are
bound.

Names aren't objects, and I don't see what you'd gain if you started
treating a name as an object; you'd merely need some additional way of
referring to *those* objects somehow.  (Meta-names, anyone?)

Since names aren't objects, the question of whether they're first-class
objects doesn't arise.

-- 
 \       "We must respect the other fellow's religion, but only in the |
  `\       sense and to the extent that we respect his theory that his |
_o__)  wife is beautiful and his children smart."  -- Henry L. Mencken |
Ben Finney <http://bignose.squidly.org/>




More information about the Python-list mailing list