A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-September/028559.html below:

[Python-Dev] Nit about `setdefault' documentation

[Python-Dev] Nit about `setdefault' documentation [Python-Dev] Nit about `setdefault' documentationFranç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



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4