python - REPL - recover callable after redefining it -
i doing work inside python repl , redefined 1 of primitive callable's.
i.e list = []
prevent tuple = list((1,2,3))
working anymore.
aside restarting repl there way 'recover' or reassign list default value?
maybe there import or super class? or forever lost , stuck assigned until restart repl?
you can delete name del list
in [9]: list = [] in [10]: list() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-10-8b11f83c3293> in <module>() ----> 1 list() typeerror: 'list' object not callable in [11]: del list in [12]: list() out[12]: []
or list = builtins.list
python3:
in [10]: import builtins in [11]: list = [] in [12]: list() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-12-8b11f83c3293> in <module>() ----> 1 list() typeerror: 'list' object not callable in [13]: list = builtins.list in [14]: list() out[14]: []
for python 2:
in [1]: import __builtin__ in [2]: list = [] in [3]: list() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-3-8b11f83c3293> in <module>() ----> 1 list() typeerror: 'list' object not callable in [4]: list = __builtin__.list in [5]: list() out[5]: []
Comments
Post a Comment