You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this morning that we don't yet have support for Python 3.8's positional-only arguments (PEP 570). This should be a nice standalone feature which anyone interested is welcome to implement. I can help mentor with any questions.
Some examples of how they interact:
>>> def foo(a, /, b):
... print(a, b)
...
>>> foo(1, 3)
1 3
>>> foo(a=1, b=2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() got some positional-only arguments passed as keyword arguments: 'a'
# Also combines with keyword-only separator
>>> def foo(a, /, *, b):
... print(a, b)
...
>>> foo(1, 3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() takes 1 positional argument but 2 were given
This will need changes in a couple of places:
The proc macro code will need to be extended to support positional-only arguments. A starting-point would be to teach add_literal which already parses "*" to also parse "/".
The runtime code to parse_fn_args will need adjusting to handle these positional-only arguments.
Both parts of the code are welcome to be refactored at the same time to deal with the additional complexity.
The text was updated successfully, but these errors were encountered:
I noticed this morning that we don't yet have support for Python 3.8's positional-only arguments (PEP 570). This should be a nice standalone feature which anyone interested is welcome to implement. I can help mentor with any questions.
Some examples of how they interact:
This will need changes in a couple of places:
"*"
to also parse"/"
.Both parts of the code are welcome to be refactored at the same time to deal with the additional complexity.
The text was updated successfully, but these errors were encountered: