PyPI / mypy-extensions / 1.1.0

mypy-extensions 1.1.0

Source
https://github.com/python/mypy_extensions
Tag scanned
1.1.0
Compared with
1.0.0 (0 signals introduced since)
Files
3 scanned, 3 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 2 info
Scan time
2.7 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 2 of 2 warn and critical signals; 2 demoted to info.
Disclude version
4.0.0
Scanned (UTC)
2026-10-14 18:28

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review frame-introspection mypy_extensions.py:18:12

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        try:
            if sys._getframe(1).f_globals['__name__'] not in ['abc', 'functools', 'typing']:
                # Typed dicts are only for static structural subtyping.
                raise TypeError('TypedDict does not support instance and class checks')
    likely benign LLM, confidence 0.95 Uses sys._getframe to verify the caller module in a TypedDict metaclass check.
    Reasoning

    sys._getframe(1) is used to check the calling module's __name__ so TypedDict instance/class checks are rejected from outside the typing machinery. This is a standard, legitimate use of frame introspection in the mypy_extensions library, not obfuscation or malicious behavior.

  2. info warn → info by review frame-introspection mypy_extensions.py:41:28

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

            # Setting correct module is necessary to make typed dict classes pickleable.
            ns['__module__'] = sys._getframe(1).f_globals.get('__name__', '__main__')
        except (AttributeError, ValueError):
            pass
    likely benign LLM, confidence 0.96 Reads the caller's module name via sys._getframe to set __module__ on a TypedDict class for pickling.
    Reasoning

    sys._getframe(1).f_globals.get('__name__') sets the __module__ attribute of a TypedDict class so it is picklable, wrapped in a benign try/except for AttributeError and ValueError. This is a well-known legitimate pattern used by typing libraries; no network, exec, or encoded payload is involved.

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.0.0
git clone https://github.com/python/mypy_extensions mypy_extensions && cd mypy_extensions
git checkout 1.1.0
disclude scan --severity info --diff 1.0.0 .