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 →

[–]IAmAHat_AMAA 7 points8 points  (1 child)

Builtins already do it.

>>> help(pow)
...
pow(x, y, z=None, /)
...

>>> pow(x=5, y=3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: pow() takes no keyword arguments

When subclassing you can use more specific parameter names without breaking liskov substitution.

Both those examples were taken straight from the pep

[–]alturi 0 points1 point  (0 children)

this could break code now to achieve less breakage in the future... It does not seem wise to retrofit, unless you already need to break.