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/131694.html below:

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

[Python-Dev] AC Derby and accepting None for optional positional arguments [Python-Dev] AC Derby and accepting None for optional positional argumentsMRAB python at mrabarnett.plus.com
Thu Jan 16 13:21:19 CET 2014
On 2014-01-16 05:32, Larry Hastings wrote:
[snip]

> In the specific case of SHA1_new's "string" parameter, we could lie and
> claim that the default value is b''.  Internally we could still use NULL
> as a default and get away with it.  But this is only a happy
> coincidence.  Many (most?) functions like this won't have a clever
> Python value we can trick you with.
>
> What else could we do?  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__"?

> The only other option I can see: don't convert SHA1_new() to use
> Argument Clinic, and don't provide introspection information for it either.
>
> Can you, gentle reader, suggest a better option?
>
>
> //arry/
>
> p.s. Ryan's function signatures above suggest that he's converting code
> from using PyArg_ParseTuple into using PyArg_ParseTupleAndKeywords.  I
> don't think he's *actually* doing that, and if I saw that in patches
> submitted to me I would ask that it be fixed.
>

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