Skip to content

Instantly share code, notes, and snippets.

@AlexWaygood
Created June 4, 2026 12:18
Show Gist options
  • Select an option

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

Select an option

Save AlexWaygood/51e74a0f4aeb4850852bc0899f565fa2 to your computer and use it in GitHub Desktop.
{"version": 1, "file_mapping": {"main.py": "main.py", "pyproject.toml": "pyproject.toml"}}
def f(x: tuple[int | str]) -> int:
match x:
case [int()]:
return 42
case [str()]:
return 42
case _:
reveal_type(x)
[project]
name = "sandbox"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = []
[tool.ty]
[tool.ty.rules]
undefined-reveal = "ignore"
[tool.pyright]
reportWildcardImportFromLibrary = false
reportSelfClsParameterName = false
reportUnusedExpression = false
[tool.pyrefly]
[tool.pyrefly.errors]
unimported-directive = false
[tool.mypy]
color_output = true
pretty = true
check_untyped_defs = true
[tool.zuban]
pretty = true
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