Commit eb596af7 authored by Romain Casati's avatar Romain Casati
Browse files

Better way to call hacking builtins functions.

parent aaac7b08
......@@ -14,9 +14,7 @@ display = __kernel__.display
download = __kernel__.download
_hack_builtins.hack_input()
_hack_builtins.hack_help()
_hack_builtins.hack_six()
_hack_builtins.hack_all()
# avoid poluting __dict__
......
......@@ -71,3 +71,12 @@ def hack_six():
path = Path('/lib/python3.8/site-packages/six.py')
assert path.exists(), "If you see this, hack_six should be useless."
path.rename('/lib/python3.8/six.py')
def hack_all():
"""
Hack all builtins by calling all hack_* methods.
"""
for name, method in globals().items():
if name.startswith('hack_') and name != 'hack_all':
method()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment