Closed drakes00 closed 5 months ago
Ok narrowing it and probably my fault here.
I traced the behavior with pdb and saw that memo.config.collection_check_strategy.iterate_samples
was defaulting to CollectionCheckStrategy.FIRST_ITEM
.
If I use @typechecked(collection_check_strategy=CollectionCheckStrategy.ALL_ITEMS)
, the behavior is as expected.
Things to check first
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
Typeguard version
4.2.1
Python version
3.11
What happened?
Hi and thanks a lot for the typeguard package!
I have a (to my understanding) similar issue as in #62 or maybe I'm just mistaking the entire recursive type idea (and I'd be very grateful to learn more about it).
Here is the following script:
I tried to setup
RecType
top be any combination of list ofint
. I would expect calls 3, 4, and 5 to raise but I'm only getting atypeguard.TypeCheckError
for call 5:I got the type definition idea from https://stackoverflow.com/questions/53845024/defining-a-recursive-type-hint-in-python Am I understanding the forward type wrong? Thanks a lot in advance,
How can we reproduce the bug?
See above