[Python-Dev] Is PEP 237 final -- Unifying Long Integers and Integers

Keith Dart kdart at kdart.com
Tue Jun 21 06:58:24 CEST 2005

On Mon, 20 Jun 2005, Keith Dart wrote:

> But then I wouldn't know if it overflowed 32 bits. In my usage, the
> integer will be translated to an unsigned (32 bit) integer in another
> system (SNMP). I want to know if it will fit, and I want to know early if
> there will be a problem, rather than later (at conversion time).
> class unsigned(long):

I guess I just clarify this more. My "unsigned" type really is an object
that represents a type of number from the external system. Previously,
there was a nice, clean mapping between external types and Python types.
Now there is not so clean a mapping. Not that that makes it a problem
with Python itself.

However, since it is sometimes necessary to interface to other systems
with Python, I see no reason why Python should not have a full set of
built in numeric types corresponding to the machine types and, in turn,
other system types. Then it would be easier (and probaby a bit faster)
to interface to them. Perhaps Python could have an "integer" type for
long/int unified types, and just "int" type as "normal" integers?


-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Keith Dart <kdart at kdart.com>
    public key: ID: F3D288E4

More information about the Python-Dev mailing list