Positional-only parameters for Python
Positional-only parameters for Python
Posted Apr 10, 2019 22:08 UTC (Wed) by quotemstr (subscriber, #45331)In reply to: Positional-only parameters for Python by yootis
Parent article: Positional-only parameters for Python
One problem is API signature ambiguity. Say I have a def foo(bar): return bar +1. People right now are allowed to call foo as foo(5) or foo(bar=5). Now suppose I want to refactor foo as "def foo(qux):return 1+qux". Is the change of the argument name a breaking API change? Only if w allow keyword argument specification for bar! Right now, we have to treat argument names as part of a function's signature, and I think that's too constricting.
