Skip to content

Typing of AttributeDict return values is broken #1656

Closed
@berndbohmeier

Description

@berndbohmeier
  • Version: 5.10.0
  • Python: 3.6
  • OS: linux

What was wrong?

Many data like events are returned as an AttributeDict, so that event['event'] and event.event both work. The typings however inherit from TypedDict, for example for EventData, so that only event['event'] correctly typechecks, but not event.event. This is annoying, as perfectly valid code does not pass typechecking.

How can it be fixed?

Somehow allow (similar to the AttributeDict for runtime) for every key to in the TypedDict to bypass typechecking also for the attribute. I sadly do not know how to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions