Python Long Masks

2008-05-14

x&y is a long when either x or y is a long. When it could/should be only when both are long.

In particular x&1 is a long whenever x is. Despite the fact that the numerical answer is either 0 or 1.

I’m not saying this is wrong, just… ugly.

Roll on Py3K.

2 Responses to “Python Long Masks”

  1. Nick Barnes Says:

    Does Py3K abolish longs? They should have done that long ago (make long a synonym for int).

  2. drj11 Says:

    Apparently so. Scary reading, by the way.

    They clearly should have done it long ago. My opinion on things like this generally is that Common Lisp is the roadmap, so just get with the program and implement it. Stop fumbling around in the dark.


Leave a Reply