Replies: 1 comment 3 replies
-
Unlike Typeguard 3, Typeguard 4 relies on type hints obtained from static analysis, and directly generates checking code for these hints. For this reason it didn't make sense to store them in the memo. While they could be put back into the memo, this would be costly and only benefit fringe cases such as this. Is this causing a lot of trouble for you? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that CallMemo in typeguard 3 has a
type_hints
field but TypeCheckMemo in typeguard 4 does nottypeguard 4:
https://github.com/agronholm/typeguard/blob/master/src/typeguard/_memo.py
typeguard 3:
https://github.com/agronholm/typeguard/blob/3.0.2/src/typeguard/_memo.py
Is
type_hints
removal confirmed for typeguard 4?For context, I'm doing some tensor shape checking and I'd like to include the type hints in my custom error message like so
I'm writing my own
typecheck_fail_callback
and using the memo.locals to construct the error messageBeta Was this translation helpful? Give feedback.
All reactions