A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-June/054280.html below:

[Python-Dev] Propose to reject PEP 336 -- Make None Callable

[Python-Dev] Propose to reject PEP 336 -- Make None Callable [Python-Dev] Propose to reject PEP 336 -- Make None CallableRaymond Hettinger raymond.hettinger at verizon.net
Fri Jun 17 08:55:26 CEST 2005
After nine months, no support has grown beyond the original poster.  The
PEP did however generate some negative responses when brought-up on
comp.lang.python (it made some people's stomach churn).

The PEP fails the tests of obviousness and necessity.  The PEP's switch
example is easily handled by replacing the callable None with a simple,
null lambda:

   def __call__(self, input):
      return {1 : self.a,
              2 : self.b,
              3 : self.c
             }.get(input, lambda *args: 0)(input)

The PEP does not address conflicts with other uses of None (such as
default arguments or indicating values that are not applicable).
Mysteriously, the PEP consumes only *args but not **kwargs.

It also fails with respect to clarity and explicitness.  Defining a
short, explicit default function is a hands-down winner in these two
important measures of merit.


Raymond

More information about the Python-Dev mailing list

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