checker dependency versions mypy==1.18.2 typing-extensions==4.15.0 mypy-extensions==1.1.0 pathspec==0.12.1 $ python -B -m mypy --version mypy 1.18.2 (compiled: yes) exit=0 $ python -B runtime_cases.py CPython 3.12.10 | Windows AMD64 PASS equal contents can have distinct identity: (True, False) PASS alias sees function mutation: (True, 2) PASS rebinding alias leaves original unchanged: (0, 2) PASS tuple retains a mutable list reference: (True, 3) PASS tuple is accepted by preview: ['hello'] PASS default limit: ['hello', 'ready'] PASS first default call: ['first'] PASS mutable default is shared: (True, ['first', 'second']) PASS None sentinel gives fresh implicit defaults: (['first'], ['second']) PASS explicit list still mutates by contract: True PASS decode creates an independent dict: (True, False) PASS absent key differs from present None: (False, True, None) PASS batch happy path: ['hello', 'ready'] PASS reject non-list batch: ValueError: batch: expected list PASS reject non-dict item: ValueError: message: expected dict PASS reject missing required key: ValueError: message: missing required field PASS reject extra key: ValueError: message: unexpected field PASS reject wrong role: ValueError: role: expected user or assistant PASS reject wrong source type: ValueError: source: expected str or None PASS reject wrong text type: ValueError: text: expected str PASS reject statically valid blank text: ValueError: text: blank is forbidden by application policy PASS unvalidated function returns int despite annotation: 'int' PASS unchecked missing field fails on dict access: KeyError: 'text' PASS cast returns the same object: True PASS TypedDict constructor produces ordinary dict: True PASS isinstance with TypedDict raises: TypeError: TypedDict does not support instance and class checks PASS isinstance with list[Message] raises: TypeError: isinstance() argument 2 cannot be a parameterized generic PASS outer list test accepts wrong element: True exit=0 $ python -B -m mypy --config-file mypy.ini --cache-dir nul message_contract.py static_good.py runtime_cases.py Success: no issues found in 3 source files exit=0 $ python -B -m mypy --config-file mypy.ini --cache-dir nul static_bad.py static_bad.py:3: error: Missing key "text" for TypedDict "Message" [typeddict-item] static_bad.py:4: error: Incompatible types (expression has type "int", TypedDict item "text" has type "str") [typeddict-item] static_bad.py:5: error: Incompatible types (expression has type "Literal['system']", TypedDict item "role" has type "Literal['user', 'assistant']") [typeddict-item] static_bad.py:6: error: Incompatible types (expression has type "int", TypedDict item "source" has type "str | None") [typeddict-item] static_bad.py:7: error: Extra key "meta" for TypedDict "Message" [typeddict-unknown-key] static_bad.py:10: error: Incompatible types (expression has type "bool", TypedDict item "text" has type "str") [typeddict-item] static_bad.py:11: error: Too many positional arguments for "preview" [misc] static_bad.py:11: error: Argument 2 to "preview" has incompatible type "str"; expected "int" [arg-type] static_bad.py:12: error: Argument "limit" to "preview" has incompatible type "str"; expected "int" [arg-type] static_bad.py:13: error: Argument 1 to "append_message" has incompatible type "tuple[Message, ...]"; expected "list[Message]" [arg-type] static_bad.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] static_bad.py:18: error: Argument 1 to "message_text" has incompatible type "object"; expected "Message" [arg-type] Found 12 errors in 1 file (checked 1 source file) exit=1 PASS summary: 28 runtime cases, 3 static positive files, 12 expected diagnostics