Skip to content

Instantly share code, notes, and snippets.

@Cheaterman
Created August 19, 2023 16:01
Show Gist options
  • Save Cheaterman/43eefb480e50021083bf249a25c3c4d5 to your computer and use it in GitHub Desktop.
Save Cheaterman/43eefb480e50021083bf249a25c3c4d5 to your computer and use it in GitHub Desktop.
magicmodule.py
import sys
class UndefinedNameLogger:
def __getattr__(self, name):
print(f'{name} not found in module {__name__}')
sys.modules[__name__] = UndefinedNameLogger()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment