Nick Coghlan added the comment:
Stefan, that proposal definitely looks like it is worth writing up as a PEP to
me. One thing that I particularly like about it is that it should be possible
to pluck out the first element of the {} entries fairly easily in order to get
the ordinary Python signature to feed to Cython or a "from string" constructor
for signature objects.
As far as the "positional-only" parameters problem goes, at one point Guido was
kicking around the idea of allowing "/" as a separator in Python function
declarations to indicate positional only arguments. So the signature of a
function that didn't accept keyword arguments at all would look like:
def addch(x, y, ch, attr, /):
...
He eventually dropped it because positional only arguments (and the need to
avoid colliding with arbitrary keyword arguments) are relatively rare in Python
code, and using an inner function together with *args is a reasonable way to
get decent error messages. However, as a way of concisely indicating
positional-only arguments in the signature of *C* functions, the idea may be
worth reconsidering.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16612>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com