On 03.03.2017 14:06, Victor Stinner wrote:
2017-03-03 6:13 GMT+01:00 Mike Miller <python-id...@mgmiller.net>:
Agreed, I've rarely found a need for a "second None" or sentinel either, but
once every few years I do.  So, this use case doesn't seem to be common
enough to devote special syntax or a keyword to from my perspective.
The question here is how to have an official support of this feature
in inspect.signature().

If we go to the special value (singleton) way, Ellispis doesn't work
neither since a few modules use Ellipsis for legit use case. Recent
user: the typing module for "Callable[[arg, ...], result]".

Exactly.

So, it should be obvious to you, that introducing "official" support leads yet to an endless chain of "but I would need yet another None" because we already use [None, Undefined, NotUsed, Ellipsis, <syntax>, pypi project] in our projects.

Having every project rolling their own "NotDefined" makes it completely incompatible to each other. So, it's not possible to plug in return values to other functions and gets bitten.


Not providing an "official" solution, solves the matter.


Best,
Sven
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to