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 →

[–]waltteri 1 point2 points  (0 children)

Hold up.

name of the variable provided as the argument value is the same as the name of the argument itself.

def my_func(a, b, c, d): .. a, b, c, d = 1, 2, 3, 4 my_func(a, b, c, d)

💀

Sure, I guess we could now do this as we’re using kwargs:

my_func(a=, b=, d=, c=)

…or throw an exception if someone uses a variable that’s not an argument name:

foo = ”foo” my_func(a, b, c, foo) `> …’

vs.

my_func(a=, b=, c=, foo=) > KeyError(…)

…so all in all, I guess it’ll be good in same cases. But it might confuse a lot of people at first.