Message182221
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. |
|
Date |
User |
Action |
Args |
2013-02-16 13:47:47 | ncoghlan | set | recipients:
+ ncoghlan, gvanrossum, barry, gregory.p.smith, jcea, mark.dickinson, pitrou, larry, eric.smith, jkloth, ezio.melotti, Arfrever, v+python, alex, Trundle, asvetlov, skrah, dmalcolm, daniel.urban, chris.jerdonek, Jim.Jewett, bfroehle, david.villa |
2013-02-16 13:47:47 | ncoghlan | set | messageid: <1361022467.42.0.394087911135.issue16612@psf.upfronthosting.co.za> |
2013-02-16 13:47:47 | ncoghlan | link | issue16612 messages |
2013-02-16 13:47:47 | ncoghlan | create | |
|