Skip to content

Instantly share code, notes, and snippets.

@AlexWaygood
Created March 2, 2026 14:47
Show Gist options
  • Select an option

  • Save AlexWaygood/c7d9b9373fdc084d17ae6c8965df6e85 to your computer and use it in GitHub Desktop.

Select an option

Save AlexWaygood/c7d9b9373fdc084d17ae6c8965df6e85 to your computer and use it in GitHub Desktop.
from typing import Callable, TypeVar, reveal_type
from .mod import y
T = TypeVar("T")
x: Callable[[T], T] = lambda obj: obj
def test(z: Callable[[T], T]):
reveal_type(x(42))
from .mod import y
reveal_type(y(42))
reveal_type(z(42))
y = lambda foo: foo
from typing import Callable, TypeVar
T = TypeVar("T")
y: Callable[[T], T]
[project]
name = "sandbox"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = ["pycroscope"]
[tool.ty]
[tool.ty.terminal]
output-format = "concise"
[tool.ty.rules]
undefined-reveal = "ignore"
[tool.pyright]
reportWildcardImportFromLibrary = false
reportSelfClsParameterName = false
reportUnusedExpression = false
[tool.zuban]
pretty = false
check_untyped_defs = true
[tool.mypy]
color_output = true
pretty = false
check_untyped_defs = true
[tool.pyrefly]
output-format = "concise"
[tool.pycroscope]
import_paths = ["."]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment