Setting the environment variable TYPEGUARD_DISABLE disables Typeguard and has the same effect as running Python with the -O flag.
I wanted to compile my Python program with Nuitka which removes the source code so that the inspect module doesn't work. However, I did not want to disable all assertians with the -O flag.
Checklist
[X] You've added tests (in tests/) added which would fail without your patch
[X] You've updated the documentation (in docs/, in case of behavior changes or new
features)
[X] You've added a new changelog entry (in docs/versionhistory.rst).
coverage: 94.458% (-0.05%) from 94.511%
when pulling 859a611d82d882037894447c8dc5107903092b0b on tage64:master
into b6a7e4387c30a9f7d635712157c889eb073c1ea3 on agronholm:master.
Changes
Setting the environment variable
TYPEGUARD_DISABLE
disables Typeguard and has the same effect as running Python with the-O
flag.I wanted to compile my Python program with Nuitka which removes the source code so that the
inspect
module doesn't work. However, I did not want to disable all assertians with the-O
flag.Checklist
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or new features)docs/versionhistory.rst
).