why is a negative shift value illegal?

Erik Max Francis max at alcyone.com
Sat Jan 13 19:46:40 EST 2001


Chris Ryland wrote:

> Why shouldn't negative shifts just mean a shift in the opposite
> direction?
> To avoid confusion? Becuse there's only way way to do things in
> Python?

I'd say shifting with negative shift values is more confusing than just
disallowing nonsensical shifts.  Probably the reason is that Python is
implemented in C, and in C, negative shifts result in undefined
behavior.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Could it be / That we need loving to survive
\__/ Neneh Cherry
    Official Buh rules / http://www.alcyone.com/max/projects/cards/buh/
 The official rules to the betting card game, Buh.



More information about the Python-list mailing list