Origin of the term "first-class object"

Rainer Deyke rainerd at eldwood.com
Mon Nov 17 22:01:35 EST 2003


John Roth wrote:
> I think I'd disagree with that. In fact, except for the optimization
> within function bodies, I can't think of anything I can't do
> with a name that I might want to.


I can think of several things.  One would be passing a name as an argument
to a function.  Given the immutability of certain Python objects, it is
often necessary to write statements in the form of
"x = f(x)".  This is a violation of the Once And Only Once principles, since
it mentions the same variable twice.

I'm not saying that the way Python deals with objects and variables is
wrong.  Language design is a series of trade-offs, and the simplicity and
clarity of Python may very well make up for its limitations.  However, that
doesn't mean that the limitations are not real.



-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com






More information about the Python-list mailing list