Skip to content

[FEATURE REQUEST] Remove if __debug__ is False checks. #139

Description

@bpleonardo

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__')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions