Typing vs Runtime Behaviour

Is there some place where all the differences between runtime behaviour vs typing behaviour documented? It would be nice to have some kind of a reference list of what discrepancies are accepted in current typing system and that users may met in the edge cases.

E.g. I’ve just met an issue with enumerate accepting __getitem__ iterables on Runtime and not accepting it in typing and then I’ve found a PR that exactly that which lead me to explanation on why this compromise is made. Another example is __buffer__ virtually implemented before 3.12.

2 Likes

Or another example just found - typing.Generator doesn’t account for return/send types having default arguments only since Python 3.13 and it’s showing false negative in Python 3.11 (see).

Which again is not a problem, it’s just annoying meeting those papercuts and discrepancies and investigating whether it’s an actual bug or there’s a reasonable explanation just to find that yes, there is, it’s just takes time to track it down.