A python problem about int to long promotion just see the idle session

gen_tricomi ogahejini at yahoo.com
Wed May 3 19:10:27 CEST 2006


Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************

IDLE 1.1.2
>>> import sys
>>> save_maxint = sys.maxint
>>> save_maxint
2147483647
>>> save_maxint += 1
>>> save_maxint
2147483648L
>>> save_maxint - 1
2147483647L
>>> save_maxint + 1
2147483649L
>>> save_maxint - 1
2147483647L
>>> save_maxint + 1
2147483649L
>>> save_maxint - 1
2147483647L
>>> save_maxint + 1
2147483649L


from the above you can see what int to long promotion is causing
i dont need to say much please see for yourself. is this a bug or
a feature.

please mail me if you can help

ogahejini at yahoo.com




More information about the Python-list mailing list