Michael Hudson wrote: > Dmitry Vasiliev <lists at hlabs.spb.ru> writes: > >>Is there a plan for implementing a base class for int and long (like >>basestring for str and unicode): >> >> >>> issubclass(int, baseint) and issubclass(long, baseint) >>True > > Not that I'm aware of. Personally, I think it's slightly more likely > that we'll have: > > >>>>int is long > > True > > but this is a long way off, and could cause upset with people who need > to do bit bashing or interface with C. Quote from PEP-237: """ A new type, integer, may be introduced that is an abstract base type of which both the int and long implementation types are subclassed. This is useful so that programs can check integer-ness with a single test: if isinstance(i, integer): ... """ So maybe correct question then: is there a plan for implementing the integer type in Python 2.4? > > Of course, > >>>>baseint = (int, long) > > makes what you type accurate today :-) -- Dmitry Vasiliev (dima at hlabs.spb.ru) http://hlabs.spb.ru
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4