Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created November 14, 2025 10:02
Show Gist options
  • Select an option

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

Select an option

Save mypy-play/a2d228294e0a7a613472376043c62642 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import NotRequired, TypedDict
class Foo(TypedDict):
key1: NotRequired[str]
key2: NotRequired[int]
foo = Foo()
for key in "key1", "key2":
reveal_type(key)
del foo[key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment