I have the following python code:
def main():
if __debug__:
print("debug mode")
else:
print("non debug")
if __name__ == '__main__':
main()
No matter whether I run the file or debug it, it always prints "debug mode". this is not what I would have expected. My debug block is computationally costly, so I Would prefer to only run it on my development machine if I am in debug mode in pycharm (and never in prod).