Does Python need a '>>>' operator?

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Apr 15 01:27:09 EDT 2002


Bengt Richter wrote:
> 
> On thinking about it, I think this is ugly, though probably
> convenient in the implementation. I.e., looking at the bits
> of the absolute value is not usually what you really want when
> you convert to hex, IMO.

The way I see it, if you're doing bit twiddling
using unified ints/longs, you should always be
working with *positive* integers, in which case
the hex representation will always be what
you want.

The only reason negative integers come into
the picture now is that setting bit 31 of a
non-long int has the side effect of making it
negative. Once ints and longs are unified,
this presumably will no longer happen.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list