python-minifier icon indicating copy to clipboard operation
python-minifier copied to clipboard

[FEATURE REQUEST] Remove if __debug__ is False checks.

Open bpleonardo opened this issue 3 months ago • 0 comments

Hi! It would be good if --remove-debug worked on the negative checks of __debug__, in that case it would just put the body of the if statement in place.

Example: Base code:

if __debug__:
    print('if __debug__')
if __debug__ is True:
    print('if __debug__ is True')
if __debug__ is False:
    print('if __debug__ is False')
if not __debug__:
    print('if not __debug__')

Current behavior with remove_debug:

if __debug__ is False:print('if __debug__ is False')
if not __debug__:print('if not __debug__')

Requested behavior with remove_debug:

print('if __debug__ is False')
print('if not __debug__')

bpleonardo avatar Nov 08 '25 21:11 bpleonardo