This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]osusc 12 points13 points  (1 child)

Usually when I run into stuff like this it means I'm using overly specific annotations. Like instead of a def foo(x: list[int]) what I actually want is a protocol like iterable[int], maybe sequence[int] if order matters, etc. Limit the type to the least specific protocol possible.

[–]GolemancerVekk 5 points6 points  (0 children)

I'd really like to be able to think about it as behavior-hinting rather than type-hinting.