Things to check first
Typeguard version
4.1.0
Python version
3.9 / 3.10 / 3.11
What happened?
When calling a @typechecked function within a suppress_type_checks context, any assignment of type annotated variables end up assigning None to the variable.
How can we reproduce the bug?
Run (from a file):
from typeguard import typechecked, suppress_type_checks
@typechecked
def foo():
bar: int = 3
print(bar)
baz = 3
print(baz)
with suppress_type_checks():
foo()
Output:
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Typeguard version
4.1.0
Python version
3.9 / 3.10 / 3.11
What happened?
When calling a
@typecheckedfunction within asuppress_type_checkscontext, any assignment of type annotated variables end up assigningNoneto the variable.How can we reproduce the bug?
Run (from a file):
Output: