PEP 285: Adding a bool type

Andrew Dalke dalke at dalkescientific.com
Tue Apr 2 04:59:28 EST 2002


Max M wrote:
>This is a common idiom:
>
>def f(names=None):
>     if names == None:
>         names = []
>     ...

Hmmm.  I would have done "if names is None".  No chance of confusing
the object with an object that overrides __cmp__.

I rarely, if ever, need tests of the form "ret == None".

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list