This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients JelleZijlstra, ncoghlan, nedbat, r.david.murray, serhiy.storchaka, yselivanov
Date 2016-06-02.22:52:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464907953.94.0.573093364775.issue19611@psf.upfronthosting.co.za>
In-reply-to
Content
> We definitely can't use a valid identifier in the code generator, since any valid identifier we used might shadow a nonlocal, global or builtin name (and the latter two cases aren't visible to the compiler at compile time).

I wasn't proposing to fix code generator, but rather to transform the name to something that users will understand in inspect.signature code.  ".0" will be extremely hard to google.

> They're also genuinely not positional only:
> >>> print(setcomp_func(**{".0": iter(range(5))}))
> {0, 1, 4, 9, 16}

My opinion on this: this is a very low-level implementation detail of CPython.  If users start abusing Signature.bind for binding ".0" they will write code that will be hard to port to other implementations, and that will also create a requirement for us (CPython devs) to maintain backwards compatibility here.

What I propose, is to rename ".0" args and to classify them as "positional-only". This would still make it possible to use Signature.bind on such callables, but in a safe way.
History
Date User Action Args
2016-06-02 22:52:33yselivanovsetrecipients: + yselivanov, ncoghlan, nedbat, r.david.murray, serhiy.storchaka, JelleZijlstra
2016-06-02 22:52:33yselivanovsetmessageid: <1464907953.94.0.573093364775.issue19611@psf.upfronthosting.co.za>
2016-06-02 22:52:33yselivanovlinkissue19611 messages
2016-06-02 22:52:33yselivanovcreate