[Python-Dev] Surely "nullable" is a reasonable name?

Tal Einat taleinat at gmail.com
Tue Apr 21 20:44:16 CEST 2015


On Tue, Apr 21, 2015 at 8:31 PM, Larry Hastings <larry at hastings.org> wrote:
>
> On 04/21/2015 04:50 AM, Tal Einat wrote:
>
> As for the default set of accepted types for various convertors, if we
> could choose any syntax we liked, something like "accept=+{NoneType}"
> would be much better IMO.
>
>
> In theory Argument Clinic could use any syntax it likes.  In practice, under
> the covers we tease out one or two bits of non-Python syntax, then run
> ast.parse over it.  Saved us a lot of work.
>
> "s: accept={str,NoneType}" is a legal Python parameter declaration; "s:
> accept+={NoneType}" is not.  If I could figure out a clean way to hack in
> support for += I'll support it.  Otherwise you'll be forced to spell it out.

Actually, I wrote "accept=+{NoneType}" - note the plus is *after* the
equal sign. This is a valid Python assignment expression. (The unary
addition operator is not defined for sets, however.)

- Tal Einat


More information about the Python-Dev mailing list