Yury Selivanov added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19611> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com