Things to check first
Typeguard version
4.1.5
Python version
3.11 / 3.12
What happened?
The following program should output the dictionary and not raise an Exception.
from __future__ import annotations
from typing import TypedDict, NotRequired
from typeguard import check_type
class TestType(TypedDict):
needed: str
notNeeded: NotRequired[str]
print(check_type({'needed': ''}, TestType))
But the following happens:
typeguard.TypeCheckError: dict is missing required key(s): "notNeeded"
BUT if you remove the first line (from __future__ import annotations), it works as expected.
How can we reproduce the bug?
Run the code once unmodified. Then run the code with the first line removed.
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.5
Python version
3.11 / 3.12
What happened?
The following program should output the dictionary and not raise an Exception.
But the following happens:
BUT if you remove the first line (
from __future__ import annotations), it works as expected.How can we reproduce the bug?
Run the code once unmodified. Then run the code with the first line removed.