Qix- / better-exceptions

Pretty and useful exceptions in Python, automatically.
MIT License
4.59k stars 202 forks source link

activate extension only when BETTER_EXCEPTIONS has true-like value: '1', 'on' or 'yes' #100

Open vanyakosmos opened 4 years ago

vanyakosmos commented 4 years ago

When you have hierarchy of environment values (eg multiple docker-compose files that override each other) it will be easier to turn on/off this extension by just changing BETTER_EXCEPTIONS from 0 to 1 and vise-versa instead of adding/removing env var from all configs each time...

Qix- commented 4 years ago

I agree. PR welcome. Just test for 1 though, nothing else.

stuaxo commented 2 years ago

is_truthy is used in some projects and covers most of the variants of this (1, along with capitalised versions of y, t, yes, true).