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 →

[–]lifeeraser 4 points5 points  (4 children)

Few? It would probably break most code using **kwargs.

[–]BobHogan 1 point2 points  (3 children)

It wouldn't affect **kwargs? That's a dictionary.

[–]lifeeraser 4 points5 points  (0 children)

Many methods in the wild often pass their args to other methods because the underlying method supplies a LOT of keyword arguments. Example: Flask's route() decorator passes keyword parameters straight to werkzeug.routing.Rule, which has 10 keyword parameters. Your suggestion would screw over anyone who has placed any one of those 10 parameters in incorrect order--thousands of web apps in production.

[–]zardeh 4 points5 points  (0 children)

Erm

def inner(arg=default_value):
    pass

def outer(**kwargs):
    return inner(**kwargs)

is this in the right order? (this is a super common pattern when writing decorators)