>>> eval('potato', {'__builtins__': None})
NameError: name 'potato' is not defined
Python2。很有道理。
>>> eval('potato', {'__builtins__': None})
TypeError: 'NoneType' object is not subscriptable
Python 3.如何/为什么eval尝试下标None?我在NameError这里也希望如此,或者可能是AttributeError: 'NoneType' object has no attribute 'potato'。
慕妹3242003
相关分类