ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved