[Python-Dev] Type of range object members

"Martin v. Löwis" martin at v.loewis.de
Wed Aug 16 17:34:48 CEST 2006


Guido van Rossum schrieb:
> I'm not sure that subclassing ints gives us much. We could make int
> and long "final" types, and then all we have to do is tweak type() and
> __class__ so that they always return the 'int' type.

I don't think this can work - there would be too many ways for the
"real" types to leak, anyway. People would come up with hacks
like reload(sys), and then complain that they have to use such
hacks.

> Alternatively, yes, there would be some minimal awareness of the two
> types in Python -- but nothing like we currently have; dispatching on
> exact type (which we discourage anyway) would be the only case. Would
> that be so bad?

I thought it was the ultimate goal of PEP 237 to unify int and long,
in all respects.

I'll do some benchmarking.

Regards,
Martin



More information about the Python-Dev mailing list