Need help with Python class idioms
ptmcg at users.sourceforge.net
Thu Jan 22 00:18:40 CET 2004
"Jonathan Daugherty" <cygnus at cprogrammer.org> wrote in message
news:mailman.611.1074719029.12720.python-list at python.org...
> # P.S. Since you're asking about idiom, it would be more Pythonic to
> # if self.mandatoryVar1 is None:
> # using the identity test "is" rather than equality test "==", since there
> # only one None.
> I'd write
> if not self.mandatoryVar1:
> but the first method works, too.
> Jonathan Daugherty
> "It's a book about a Spanish guy called Manual, you should read it."
> -- Dilbert
... what if mandatoryVar1 was set to False?
More information about the Python-list