Open lucascolley opened 4 days ago
Yes, this is a known issue. There are some instances where the Python typing rules disallow certain things and we've opted to keep the annotations accurate in those cases. Implementations may need to adjust them until the upstream typing rules can be fixed.
Spec:
ord: int | float | ~typing.Literal[inf, -inf] = 2
Stubs:
ord: Union[int, float, Literal[inf, -inf]] = 2
Literals
docsA relevant issue: https://github.com/python/typing/issues/1160
I don't know if anything can be done, and this was probably done deliberately, but useful to have an issue nonetheless.