代码遇到TypeError: ‘str‘ object does not support item assignment怎么解决啊各位大佬!救救孩子吧!
原代码:
for j, a in enumerate(args): with contextlib.suppress(NameError): try: args[j] = eval(a) if isinstance(a, str) else a # eval strings except: args[j] = a
代码遇到TypeError: ‘str‘ object does not support item assignment怎么解决啊各位大佬!救救孩子吧!
原代码:
for j, a in enumerate(args): with contextlib.suppress(NameError): try: args[j] = eval(a) if isinstance(a, str) else a # eval strings except: args[j] = a