shift operators?

Andrew Koenig ark at research.att.com
Mon Jan 7 13:05:15 EST 2002


Now that the arithmetic operators overflow gracefully from
int to long, I wonder if there are plans to do the same for
the shift operators.  For example:

        >>> (1<<20) * (1<<20)  
        1099511627776L
        >>> 1<<40
        0

Is it just backward compatibility that keeps 1<<40 from yielding
1099511627776L as well?

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list