[Python-Dev] Unifying Long Integers and Integers: baseint

Guido van Rossum guido at python.org
Fri Aug 13 04:35:24 CEST 2004


> Guido:
> 
> > > if the only reason for it is to use isinstance?
> > 
> > So that an extension author *could* write an int-like type deriving
> > from it?
> 
> But didn't you just say that people shouldn't be
> deriving their own int-like types from baseinteger?

Indeed, in general they shouldn't.  But for specialized purposes it
might be needed (that's why I emphasized *could*).

Unfortunately, for the purpose of having one's ersatz integers
accepted as the real thing by the Python core, you pretty much have to
inherit from int.

So my only reason to make baseinteger a class rather than a tuple is
consistency with basestring.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list