Skip to content

Instantly share code, notes, and snippets.

@carljm
Created April 24, 2026 20:38
Show Gist options
  • Select an option

  • Save carljm/87c2b480f38654cc03e6b63da3212d66 to your computer and use it in GitHub Desktop.

Select an option

Save carljm/87c2b480f38654cc03e6b63da3212d66 to your computer and use it in GitHub Desktop.
{"version": 1, "file_mapping": {"main.py": "main.py", "pyproject.toml": "pyproject.toml"}}
from typing import TypedDict, Protocol, Unpack
class TD(TypedDict):
v1: int
class TD2(TD):
v2: int
class P(Protocol):
def __call__(self, **kwargs: Unpack[TD]): ...
def f2(*, v1: int): ...
def apply(callback: P, kwargs: TD):
callback(**kwargs)
td2: TD2 = {"v1": 1, "v2": 2}
apply(f2, td2)
[project]
name = "sandbox"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = []
[tool.ty]
[tool.ty.terminal]
output-format = "concise"
[tool.ty.rules]
undefined-reveal = "ignore"
empty-body = "ignore"
[tool.mypy]
color_output = true
check_untyped_defs = true
disable_error_code = ["empty-body"]
[tool.pyright]
reportWildcardImportFromLibrary = false
reportSelfClsParameterName = false
reportUnusedExpression = false
[tool.zuban]
check_untyped_defs = true
[tool.pycroscope]
import_paths = ["."]
[tool.pyrefly]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment