Skip to content

Compatibility between typed dicts and instance types #2493

Closed
@JukkaL

Description

@JukkaL

Currently the fallback type of typed dicts is Mapping[str, join(item_types)]. This might be too limiting for some typical use cases. For example, maybe a typed dict should be compatible with Dict[str, Any] (and vice versa).

One idea is to keep the fallback like that, but special case compatibility with Dict[str, Any] (maybe also MutableMapping[str, Any]).

We may want to wait until typed dict support is more complete and try it in practice with production code before deciding what to do with this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions