question of style

Lie Ryan lie.1296 at gmail.com
Fri Jul 3 08:33:03 CEST 2009


Paul Rubin wrote:
> Generally, having a special
> value like None to denote a missing datum was considered standard
> practice a few decades ago, 

I guess in python, None as the missing datum idiom is still quite prevalent:

def cat_list(a=None, b=None):
    # poor man's list concatenation
    if a is None and b is None: return []
    if a is None: return b
    if b is None: return a
    return a + b



More information about the Python-list mailing list