Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created January 14, 2026 15:36
Show Gist options
  • Select an option

  • Save mypy-play/c475a85d2c22f3d0f97574c208e90c30 to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/c475a85d2c22f3d0f97574c208e90c30 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import TypedDict
from typing import ReadOnly
from typing import Required
class GitParameters_A(TypedDict, total=False):
git_projectcollection_url: str
git_commit_hash: str
git_branch: str
git_repository_id: Required[str]
class GitParameters_B(TypedDict, total=False):
git_projectcollection_url: ReadOnly[str]
git_commit_hash: ReadOnly[str]
git_branch: ReadOnly[str]
git_repository_id: ReadOnly[Required[str]]
class GitParameters_C(TypedDict, total=False):
git_checkout_lfs: bool
git_checkout_nested_submodules: bool
git_checkout_submodules: bool
git_commit_hash: str
git_commit_url: str
git_projectcollection_url: Required[str]
git_ref: str
git_repository_id: Required[str]
git_repository_url: Required[str]
git_team_project_id: Required[str]
git_branch: str
def foo(x: GitParameters_C) -> None:
y: GitParameters_A = x
z: GitParameters_B = x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment