You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow fields on a TypedDict to be subtypes of their declared types.
TypedDicts appear to have explicitly decided not to accept subtypes on fields,
but this behavior is counter intuitive. This made it so TypedDicts didn't
respect `Any` and caused problems with what should have been ducktype
compatible. This also brings TypedDicts more in line with other container
types and with how fields on classes behave.
```python
from typing import Dict
def foo() -> Dict[float, object]:
return {
1: 32
}
```
This fixes#2610
0 commit comments