A newbie question about class

Jason Orendorff jason at jorendorff.com
Sun Feb 10 23:06:22 EST 2002


Joshua Muskovitz writes:
> And yet, unless you do use things like "!= None", bugs in packages like
> FixedPoint would propogate.  It's a double edged sword.  Being able to use
> "is not None" is a good way to be able to work around a bug like this (if
> you don't have access to the source, for example), but I would hesitate to
> say that it is "better".

The wording "x is not None" is preferred stylistically.
It is done this way throughout the standard library.
(The score is 445 to 2.)

It also runs faster and will not throw surprise exceptions.

So, don't hesitate.  :)

## Jason Orendorff    http://www.jorendorff.com/





More information about the Python-list mailing list