我以为我定义了一个元组。幸运的是它工作了很长时间。在一个特定的点上,它坏了->发现它实际上不是元组。最后,我期望像这样的里面有1个字符串的元组
("expected tuple")
令人困惑,请解释
if any(key in [tuple("expect tuple"), tuple(("expect tuple"),),("expect tuple")] for key in [(("expect tuple"),)]):
print("same")
Run Code Online (Sandbox Code Playgroud)