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/2001-October/017998.html below:

[Python-Dev] Function arguments

[Python-Dev] Function argumentsFred L. Drake, Jr. fdrake@acm.org
Thu, 18 Oct 2001 08:00:00 -0400
Thomas Heller writes:
 > I was thinking of a popitem() dictionary method taking
 > (optionally) 2 arguments: the name of the item to pop,
 > and the default value to return if the item is not present

  A one-arg version of the {}.popitem() method was discussed
extensively, but some people did not think it sufficiently useful to
include that variation.  (I don't think anyone suggested a 2-arg
version at the time.)
  This certainly leads me to think the decision not to support a
one-arg version should be considered, or maybe a two-arg version.
However, I do expect the usage with args and without args are
substantially different.  Perhaps there should be a different method
that has the one- and two-arg versions you describe, but does not
support the 0-arg semantics of the current popitem()?  The catch is
that I'd name this popitem() as well.  ;-)
  Anyone else?


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation




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