Skip to content

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Mar 31, 2017

This is a slightly updated version of @rowillia's PR #2621.

Roy Williams and others added 6 commits January 6, 2017 14:06
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
@JukkaL JukkaL merged commit 2f6d620 into master Mar 31, 2017
@gvanrossum gvanrossum deleted the rowillia-fix_typed_dict_duck_typing branch April 1, 2017 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants