You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if beartype could detect TypedDict annotations. Currently (v0.17.0), all dicts pass a TypedDict test. Example:
frombeartype.doorimportis_bearablefromtypingimportTypedDictclassABC(TypedDict):
a: intprint(is_bearable({}, ABC)) # -> True, should be Falseprint(is_bearable({"b": 2}, ABC)) # -> True, should be Falseprint(is_bearable({"a": "a"}, ABC)) # -> True, should be False
The text was updated successfully, but these errors were encountered:
tvdboom
changed the title
[Feature request] Support for TypeDict
[Feature request] Support for TypedDictJan 29, 2024
Absolutely right. As always, you force us to become better people.
2024 is the year that @beartype finally goes hard on deep type-checking. So, this is happening. Still, we should (probably) deeply type-check standard dictionary type hints like dict[str, int] and standard mapping type hints like typing.MutableMapping[Any, bytes] first. That probably puts deep type-checking of typing.TypedDict more towards the end than the beginning of 2024. I'm so sorry for your codebase. 😭
It would be nice if
beartype
could detectTypedDict
annotations. Currently (v0.17.0), all dicts pass aTypedDict
test. Example:The text was updated successfully, but these errors were encountered: