[Python-Dev] Unifying Long Integers and Integers: baseint
bac at OCF.Berkeley.EDU
Thu Aug 19 23:42:00 CEST 2004
Michael Chermside wrote:
>>>>>if the only reason for it is to use isinstance?
>>>>So that an extension author *could* write an int-like type deriving
>>>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.
I'm with Michael on this. We have gone this long without having a need
for a baseinteger type (when was long introduced?) so I don't see a need
to add it now. Let's just live with the dichotomy until Python 3000
(moving over to 3000 as Guido suggested in the "PEP 3000" thread) comes out.
More information about the Python-Dev