Re: Identity inconsistency and unification of types and classes
by Erik Max Francis other posts by this author
Jul 1 2003 4:00AM messages near this date
Re: Identity inconsistency and unification of types and classes
|
Suggesting for overloading the assign operator
Rim wrote:
> With the great unification of types and classes, what will happen to
> the
> following identity inconsistency?
>
> >>> class myint(int): pass
> ...
> >>> a=int(1); b=int(1)
> >>> a is b
> 1
> >>> a=myint(1); b=myint(1)
> >>> a is b
> 0
Whether or not int(1) is int(1) is purely an optimization issue, so one
wonders why one would be concerned about it.
--
Erik Max Francis && max@[...].com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ They have rights who dare defend them.
\__/ Roger Baldwin
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Rim
Michael Hudson
Moshe Zadka
Erik Max Francis
|