PEP 308 original proposal "used" already in Python Documentation

Christoph Becker-Freyseng webmaster at
Mon Mar 3 13:11:07 CET 2003


I just found something funny in Python's Documentation.
In 2.1.6 Mapping Types you can find the following:

a.get(k[, x])            a[k] if k in a, else x     (4)
a.setdefault(k[, x])     a[k] if k in a, else x     (also setting it)  (5)

It looks very similar to the original proposalof PEP 308, but it's the 
explanation of {}.get and {}.setdefault .

Christoph Becker-Freyseng

More information about the Python-list mailing list