3 ms·
Is this a new thing? I thought that was possible in Python already. Look at the numpy documentation: https://docs.scipy.org/doc/numpy/reference/generated/numpy.
by r0f1 7y ago
Is this a new thing? I thought that was possible in Python already. Look at the numpy documentation: https://docs.scipy.org/doc/numpy/reference/generated/numpy.maximum.html https://docs.scipy.org/doc/numpy/reference/generated/numpy.m.... There, they already use the / for positional-only arguments.
- masklinn 7y ago> Is this a new thing? I thought that was possible in Python already. Yes and no: the syntax was used in documentation (that's the "argument clinic" mentioned in the article) and Python functions defined in C were able to define positional-only parameters, but it's a new thing for Python code: before 3.8, it's not possible to define positional-only parameters in pure Python[0], with it the "argument clinic" syntax becomes actual Python syntax (rather than pseudo-python). [0] well you can use *args and a bunch of hand-rolled assertions