[Python-Dev] Unifying Long Integers and Integers: baseint
mcherm at mcherm.com
Mon Aug 16 14:37:47 CEST 2004
> > > > 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*).
I call YAGNI. We're talking about creating the class baseinteger
which might be useful ONLY for people creating new kinds of integers
in Python which will NOT extend int or long but WILL need to be
treated just like integers. Who is really likely to do that? And if
in the process we introduce a new class which won't be needed in
the long run (ie Python 3000 has just one type, called "int" and has
no need for baseinteger). So I maintain that it's not needed (and
is, in fact, confusing to users) unless someone has a real use case.
-- Michael Chermside
More information about the Python-Dev