Re: Identity inconsistency and unification of types and classes
by Michael Hudson other posts by this author
Jul 14 2003 11:15AM messages near this date
Identity inconsistency and unification of types and classes
|
Re: Identity inconsistency and unification of types and classes
rimbalaya@[...].com (Rim) writes:
> Hi,
>
> 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
Nothing, as is. You can always dick about in myint.__new__ if you
really want to manage that, but as others keep saying, you shouldn't
worry about it too much.
Cheers,
M.
--
My hat is lined with tinfoil for protection in the unlikely event
that the droid gets his PowerPoint presentation working.
-- Alan W. Frame, alt.sysadmin.recovery
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Rim
Michael Hudson
Moshe Zadka
Erik Max Francis
|