With Python 3.11.0a2+, and the following code:
def my_fun(e):
match e:
case (1,):
print("tuple (1,)")
case [1]:
print("list [1]")
case _:
print("I don't understand")
Calling the function with my_fun([1]) prints "tuple (1,)".
Is this behavior correct?
If I explicitly match against tuple((1, )) instead of (1,), it works as expected.
If this is not a bug of the interpreter, what is the reason behind this seemingly weird behavior?