python / python/mypy

Update InlineTypedDict Implementation to conform to PEP 764 Specification

Open
#18,748 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature topic-typed-dict
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Feature

Align the experimental InlineTypedDict feature with the PEP 764 specification.

Pitch

The current experimental InlineTypedDict syntax in mypy allows for concise inline TypedDict definitions, but it does not fully conform to the PEP 764. Updating this feature to adhere to PEP 764 would ensure consistency with the official Python typing standards and enhance compatibility across type checkers and codebases.

Example of the PEP 764 syntax:


def func(n: str, y: int) -> TypedDict[{"name": str, "year": int}]:
    return {"name": n, "year": y}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PEP 764 and comparing its syntax and requirements with mypy's current experimental InlineTypedDict implementation. The issue names no files, tests, or entry points, so locate the implementation and related test coverage before planning the change. Done means the feature conforms to the PEP 764 example and requirements, with tests covering the supported syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.