PyCQA / flake8-bugbear

A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New check finding usage of __debug__

kasium opened this issue · comments

commented

Python has a weird built-in variable called __debug__ which is true when not running in optimized mode.
I guess there is only a limited number of packages using optimized mode, therefore using __debug__ spoils the code.

What do you think about a simple check finding __debug__ ? I'm happy to contribute it 😄

The purpose of this linter is to highlight code that is likely to indicate bugs. How would this proposed check help with that purpose? I'd assume people who use __debug__ generally know what they're doing.