Say I have a file that's only used in pre-production code
I want to ensure it gets not run in production code- any calls out to it have to fail.
This snippet at the top of the file doesn't work - it breaks the Python grammar, which specifies that return
must take place in a function.
if not __debug__:
return None
What is the best solution here - the one that doesn't involve making a gigantic else, that is. :-)