PEP 570: Python Positional-Only Parameters

The “problems” in argument clinic only exist because they predate argument clinic. Larry tried very hard to avoid adding anything new, but had no choice because some existing built in functions essentially dispatch on argument count and cannot reasonably support named parameters (such as range).

I’m sympathetic to the “func, **{“func”: Value}” case, but it feels very contrived - I’ve never seen an actual complaint about this. And this is easily achieved with the tricks already listed here, along with plenty of other approaches (such as using a parameterless lambda with a closure).

If/when you get to counting, count me as -1. And honestly I’d go as far as changing the builtins like range() to support named arguments no matter how ugly the implementation gets. Knowing that every argument can be specified by name is a feature, and I’m not convinced abandoning that is worth it.

1 Like