siuba icon indicating copy to clipboard operation
siuba copied to clipboard

Prevent variable name issues by using position only args for Call (requires python3.8)

Open machow opened this issue 2 years ago • 0 comments

Once python 3.7 support is dropped, we should update Call to use position only arguments:

from siuba.siu import Call

# errors because func is name of first parameter
Call("some_operation", 1, 2, func = 3)

Benefit of position only args:

def f(a, b, /, *args, **kwargs):
    print(a)
    print(kwargs)

# prints
# 1
# {"a": 3}
f(1, 2, a = 3)

machow avatar Jan 22 '22 18:01 machow