Skip to content

TypedDict alternative definition syntax with keyword args is confusing #981

@97littleleaf11

Description

@97littleleaf11

Originally opened in https://bugs.python.org/issue46066.
Related discussion: python/mypy#2492

According to the documentation, there are two additional equivalent syntax for TypedDict definition:

Point2D = TypedDict('Point2D', x=int, y=int, label=str)
Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

However, the former one is quite confusing since we have the total keyword arg for TypedDict. In addition, PEP589 doesn't have this syntax.

I think we could just deprecated it and remove it from the doc.

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy