Python(2.7.2)では、なぜ
import dis
dis.dis("i in (2, 3)")
期待どおりに動作しますが
import dis
dis.dis("i in [2, 3]")
レイズ:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dis.py", line 45, in dis
disassemble_string(x)
File "/usr/lib/python2.7/dis.py", line 112, in disassemble_string
labels = findlabels(code)
File "/usr/lib/python2.7/dis.py", line 166, in findlabels
oparg = ord(code[i]) + ord(code[i+1])*256
IndexError: string index out of range
これはPython3には影響しないことに注意してください。