Skip to content

Instantly share code, notes, and snippets.

@dcreager
Created May 14, 2026 16:29
Show Gist options
  • Select an option

  • Save dcreager/4ed70780b8bd851fbabb133119abeb86 to your computer and use it in GitHub Desktop.

Select an option

Save dcreager/4ed70780b8bd851fbabb133119abeb86 to your computer and use it in GitHub Desktop.
{"version": 1, "file_mapping": {"main.py": "main.py", "pyproject.toml": "pyproject.toml"}}
import random
from typing_extensions import reveal_type
def choose[A](a1: A, a2: A) -> A:
return random.choice([a1, a2])
reveal_type(choose(None, 2))
[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"
[tool.pyright]
reportWildcardImportFromLibrary = false
reportSelfClsParameterName = false
reportUnusedExpression = false
[tool.pyrefly]
output-format = "min-text"
[tool.pyrefly.errors]
unimported-directive = false
[tool.mypy]
color_output = true
pretty = false
check_untyped_defs = true
[tool.zuban]
pretty = false
check_untyped_defs = true
[tool.pycroscope]
import_paths = ["."]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment