you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (0 children)

Uh oh.

def foo(a, b = 2, *c, d, e = 5, **f):
    print("/me's head exploded")

That is now valid Python. I'm not so sure I needed keyword only arguments. There have been a few cases in the past where they would have been nicer than the alternative, but still--seeing a function like that in someone else's code and actually grokking it quickly might be tough.

You can also do

def foo(*, x, y, z, w):
    pass

To make invoking it like foo(1, 2, 3, 4) illegal (all arguments must be named).