Question #313

Considering the code snippet below, which function call is not allowed? (3.8+)
def f(a=2, /):
    pass

In the code snippet above, f(a=1) is not allowed. The function accepts a positional argument that is optional. If the function is called as f(a=1) , the passed argument is not positional and as such, it will throw a SyntaxError error. (stackoverflow.com/questions/9450656)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: