[Python-Dev] Nit about `setdefault' documentation

François Pinard pinard@iro.umontreal.ca
Tue, 03 Sep 2002 20:31:50 -0400


Quite a small nit.  Reading:

---------------------------------------------------------------------->
>>> help({}.setdefault)
Help on built-in function setdefault:

setdefault(...)
    D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)
----------------------------------------------------------------------<

I wonder if writing the last line as:

---------------------------------------------------------------------->
    D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
----------------------------------------------------------------------<

would not better represent Python current fashion. :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard