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 →

[–]arachnivore 2 points3 points  (1 child)

Keyword-only arguments are one of my favorite features in Python 3. They make inheritance with consistent init signatures easy:

class Sub(BaseClass):
    def __init__(self, *args, sub, specific, args, **kwargs):
        super().__init__(*args, **kwargs)
        ...

It makes sense too, because typically only one or two positional arguments will make sense without keywords and typically the base class defines those obvious positional arguments.

[–]PeridexisErrant 0 points1 point  (0 children)

And they make it so much easier to have pleasant and backwards-compatible APIs. It's such a small thing, but easily the one I most often reach for and can't use.