WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@bpleonardo

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

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