Closed thomasahle closed 1 year ago
Hi @thomasahle, this is a good idea. I think this should hook into the builtin __debug__
constant, e.g.:
x = 10
if __debug__:
print(f"Debug: {x=}")
print(x**2)
And that whole block would be removed if a --remove-debug
option was set.
Version 2.8.0 has been released which includes --remove-debug
Thank you for this amazing library!
One thing I often find myself doing is commenting out debug code, or other non-essentials, before minifying. I'm wondering if it would make sense to add some kind of "remove all of this during minify" blocks, which would be ignored when running the program normally, but deleted by minifier. For example:
Thanks again for this amazing work. I'm using it to greatly compress sunfish (https://github.com/thomasahle/sunfish) for the sub 4K chess engine competition :)