Skip to content

Python 3.10 Do not list NotRequired in __required_keys__ #702

@Daraan

Description

@Daraan

It suprises me that this went unnotices and tested. NotRequired is a feature of 3.11 but the backport is lacking on <=3.10, as the following example shows

from typing_extensions import TypedDict, NotRequired

class Foo(TypedDict):
     a : NotRequired[int]


print(Foo.__required_keys__)  # should be empty.
# frozenset({'a'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions