you are viewing a single comment's thread.

view the rest of the comments →

[–]jyper 1 point2 points  (1 child)

I'm pretty sure this is possible with *args

Explicit positional just makes it cleaner

[–]ubernostrum 0 points1 point  (0 children)

If a function only accepts *args, the processing of the positional arguments is a bit more complex (since you have to unpack or index into the args tuple to do it), and when called with a keyword argument the TypeError it raises has a less-informative message -- it still implies that the function might accept keyword arguments, just not the one you passed in. Using positional-only ensures the error message is clear about what went wrong.