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/2014-January/131726.html below:

[Python-Dev] AC Derby and accepting None for optional positional arguments

[Python-Dev] AC Derby and accepting None for optional positional argumentsMark Shannon mark at hotpy.org
Thu Jan 16 21:15:23 CET 2014
On 16/01/14 19:43, Larry Hastings wrote:
> On 01/16/2014 04:21 AM, MRAB wrote:
>> On 2014-01-16 05:32, Larry Hastings wrote:
>> [snip]
>>
>>> We could add a special value, let's call it
>>> sys.NULL, whose specific semantics are "turns into NULL when passed into
>>> builtins".  This would solve the problem but it's really, really awful.
>>>
>> Would it be better if it were called "__null__"?
>
> No.  The problem is not the name, the problem is in the semantics. This
> would mean a permanent special case in Python's argument parsing (and
> "special cases aren't special enough to break the rules"), and would
> inflict these same awful semantics on alternate implementations like
> PyPy, Jython, and IronPython.

Indeed.

Why not just change the clinic spec a bit, from
'The "default" is a Python literal value.' to
'The "default" is a Python literal value or NULL.'?

A NULL default would imply the parameter is optional
with no default.


Cheers,
Mark.
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