PEP 285: Adding a bool type

Max M maxm at mxm.dk
Tue Apr 2 02:30:18 EST 2002


Steve Holden wrote:


> Arguably, most of that code should have read
> 
>     if ret:
>         ...
> 
> rather than
> 
>     if ret == None:
>         ...
> 
> since the latter has the flavor of "if expr==True".
> 
> So, is breaking bad code more excusable than breaking good code ;-)?


Oh I don't think so. This is a common idiom:

def f(names=None):
     if names == None:
         names = []
     ...


regards Max M




More information about the Python-list mailing list