Skip to content

Is is_typeddict with Generics supposed to eval to false? #2270

Description

@semohr

Is is_typeddict supposed to return False for generic TypedDict specializations, or is this a bug? The documentation does not mention this.

Example:

from typing import is_typeddict, Generic, TypeVar, TypedDict

A = TypeVar("A", bound=TypedDict)

class Attributes(TypedDict, total=False):
    title: str

class Resource(TypedDict, Generic[A]):
    a: A 
    
print(is_typeddict(Resource[Attributes]))
# False
# Would have expected True...

Live demo: https://www.online-python.com/Pa6C0sWjIh

Hope this is the right place to report this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: otherOther topics not covered

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions