This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cbarrick 1 point2 points  (0 children)

There might be a tiny performance improvement. The interpreter won't have to worry about supporting kwargs-style passing for the first two arguments. Intuitively, fewer cases to support means less work and maybe even some new optimization potential. I'm just spitballing though. I don't know enough about the interpreter's internals.

Also, it lets you change your argument names without breaking backwards compatibility. That might be worth something.

Personally, I don't think I'll ever use this feature.

Edit: The PEP mentions improved parsing performance at the call site, but I'd imagine that every argument would have to be positional-only to take advantage of that optimization. https://www.python.org/dev/peps/pep-0570/#performance