From f5e65715b04a39c544d9623fea389a943bb671be Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 01:37:27 -0400 Subject: [PATCH 01/10] boilerplate --- CHANGELOG.md | 260 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdb888ff9d6..8740880327e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,266 @@ ## Next Release +## Mypy 1.18 (Unreleased) + +We’ve just uploaded mypy 1.16 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). +Mypy is a static type checker for Python. This release includes new features and bug fixes. +You can install it as follows: + + python3 -m pip install -U mypy + +You can read the full documentation for this release on [Read the Docs](http://mypy.readthedocs.io). + + * [mypyc] Fix subclass processing in detect_undefined_bitmap (Chainfire, PR [19787](https://github.com/python/mypy/pull/19787)) + * feat: new mypyc primitives for weakref.proxy (BobTheBuidler, PR [19217](https://github.com/python/mypy/pull/19217)) + * Make --allow-redefinition-new argument public (Ivan Levkivskyi, PR [19796](https://github.com/python/mypy/pull/19796)) + * [stubtest] temporary `--ignore-disjoint-bases` flag (Joren Hammudoglu, PR [19740](https://github.com/python/mypy/pull/19740)) + * [mypyc] Fix C function signature (Jukka Lehtosalo, PR [19773](https://github.com/python/mypy/pull/19773)) + * Mypy micro-optimizations (batch 3/3) (Jukka Lehtosalo, PR [19770](https://github.com/python/mypy/pull/19770)) + * Use empty context as fallback for return statements (Ivan Levkivskyi, PR [19767](https://github.com/python/mypy/pull/19767)) + * Update stubinfo for latest typeshed (Shantanu, PR [19771](https://github.com/python/mypy/pull/19771)) + * Mypy micro-optimizations (batch 2/3) (Jukka Lehtosalo, PR [19769](https://github.com/python/mypy/pull/19769)) + * Mypy micro-optimizations (batch 1/3) (Jukka Lehtosalo, PR [19768](https://github.com/python/mypy/pull/19768)) + * Use fast Python wrappers in native_internal (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765)) + * Try fixing test times after GC hack (Ivan Levkivskyi, PR [19766](https://github.com/python/mypy/pull/19766)) + * Use some macros in native_internal (Ivan Levkivskyi, PR [19757](https://github.com/python/mypy/pull/19757)) + * Add idlemypyextension to IDE integrations section (CoolCat467, PR [18615](https://github.com/python/mypy/pull/18615)) + * `--strict-equality` for `None` (Christoph Tyralla, PR [19718](https://github.com/python/mypy/pull/19718)) + * Do not display import-related errors after module-level always false assert (Stanislav Terliakov, PR [19347](https://github.com/python/mypy/pull/19347)) + * Fix forward references in type parameters of overparameterized PEP 695 type aliases (Brian Schubert, PR [19725](https://github.com/python/mypy/pull/19725)) + * [mypyc] Use defined __new__ method in tp_new and constructor (Piotr Sawicki, PR [19739](https://github.com/python/mypy/pull/19739)) + * [mypyc] Speed up implicit __ne__ method (Jukka Lehtosalo, PR [19759](https://github.com/python/mypy/pull/19759)) + * [mypyc] Speed up equality with optional str/bytes types (Jukka Lehtosalo, PR [19758](https://github.com/python/mypy/pull/19758)) + * [mypyc] Refactor IR build of equality and unary operators (Jukka Lehtosalo, PR [19756](https://github.com/python/mypy/pull/19756)) + * Use more compact cache representation for int and str (Ivan Levkivskyi, PR [19750](https://github.com/python/mypy/pull/19750)) + * Fix crash with variadic tuple arguments to generic type (Randolf Scholz, PR [19705](https://github.com/python/mypy/pull/19705)) + * Don't write constructor cache without strict optional (Ivan Levkivskyi, PR [19752](https://github.com/python/mypy/pull/19752)) + * Do not use outer context for `or` expr inference if the LHS has Any (Stanislav Terliakov, PR [19748](https://github.com/python/mypy/pull/19748)) + * Use u8 for type/symbol tags (Ivan Levkivskyi, PR [19741](https://github.com/python/mypy/pull/19741)) + * [mypyc] feat: `__mypyc_empty_tuple__` constant (BobTheBuidler, PR [19654](https://github.com/python/mypy/pull/19654)) + * Cleanup old ast classes in fastparse (Marc Mueller, PR [19743](https://github.com/python/mypy/pull/19743)) + * Fix unwrapping assignment expressions in match subject (Marc Mueller, PR [19742](https://github.com/python/mypy/pull/19742)) + * Use 1 byte per type/symbol tag (Ivan Levkivskyi, PR [19735](https://github.com/python/mypy/pull/19735)) + * [mypyc] feat: PyObject_CallObject op for fn(*args) fastpath (BobTheBuidler, PR [19631](https://github.com/python/mypy/pull/19631)) + * Omit errors for class pattern matches against object (Marc Mueller, PR [19709](https://github.com/python/mypy/pull/19709)) + * Revert "Enable colored output for argparse help in Python 3.14 (#19021)" (Marc Mueller, PR [19721](https://github.com/python/mypy/pull/19721)) + * Update dependencies (Marc Mueller, PR [19720](https://github.com/python/mypy/pull/19720)) + * Include base mypy requirements in docs requirements (Brian Schubert, PR [19727](https://github.com/python/mypy/pull/19727)) + * More detailed checking of type objects in stubtest (Stephen Morton, PR [18251](https://github.com/python/mypy/pull/18251)) + * Remove unnecessary error message for match class patterns (Marc Mueller, PR [19708](https://github.com/python/mypy/pull/19708)) + * stubtest: handle overloads with mixed pos-only params (Stephen Morton, PR [18287](https://github.com/python/mypy/pull/18287)) + * Somewhat better support for isinstance on old-style unions (Shantanu, PR [19714](https://github.com/python/mypy/pull/19714)) + * Use union for captured vars in or pattern (Marc Mueller, PR [19710](https://github.com/python/mypy/pull/19710)) + * stubtest: flag redundant @disjoint_base decorators (Jelle Zijlstra, PR [19715](https://github.com/python/mypy/pull/19715)) + * stubtest: correct "argument" → "parameter" terminology in error messages (PrinceNaroliya, PR [19707](https://github.com/python/mypy/pull/19707)) + * stubtest: get better signatures for `__init__` of C classes (Stephen Morton, PR [18259](https://github.com/python/mypy/pull/18259)) + * stubtest: do not require @disjoint_base if there are __slots__ (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) + * [mypyc] feat: extend stararg fastpath from #19629 with star2 fastpath (BobTheBuidler, PR [19630](https://github.com/python/mypy/pull/19630)) + * Fail gracefully on unsupported template strings (PEP 750) (Brian Schubert, PR [19700](https://github.com/python/mypy/pull/19700)) + * Don't expand PEP 695 aliases when checking node fullnames (Brian Schubert, PR [19699](https://github.com/python/mypy/pull/19699)) + * More efficient (fixed-format) serialization (Ivan Levkivskyi, PR [19668](https://github.com/python/mypy/pull/19668)) + * Implement PEP 800 (@disjoint_base) (Jelle Zijlstra, PR [19678](https://github.com/python/mypy/pull/19678)) + * [mypyc] Optimize type(x) and x.__class__ (Jukka Lehtosalo, PR [19691](https://github.com/python/mypy/pull/19691)) + * [mypyc] Specialize bytes.decode calls with common encodings (Jukka Lehtosalo, PR [19688](https://github.com/python/mypy/pull/19688)) + * Force all deserialized objects to the oldest GC generation (Ivan Levkivskyi, PR [19681](https://github.com/python/mypy/pull/19681)) + * [mypyc] feat: extend stararg fastpath from #19623 to handle lists and generic sequences (BobTheBuidler, PR [19629](https://github.com/python/mypy/pull/19629)) + * [mypyc] Add primitive for .__name__ (Jukka Lehtosalo, PR [19683](https://github.com/python/mypy/pull/19683)) + * [mypyc] Speed up "in" against final fixed-length tuple (Jukka Lehtosalo, PR [19682](https://github.com/python/mypy/pull/19682)) + * [mypyc] Refactor building IR for "in" against a tuple (Jukka Lehtosalo, PR [19679](https://github.com/python/mypy/pull/19679)) + * Sort arguments in TypedDict overlap error message (Marc Mueller, PR [19666](https://github.com/python/mypy/pull/19666)) + * [mypyc] Remove unreachable code (Jukka Lehtosalo, PR [19667](https://github.com/python/mypy/pull/19667)) + * [mypyc] feat: optimize f-string building from Final values (BobTheBuidler, PR [19611](https://github.com/python/mypy/pull/19611)) + * fix: prevent false positive "untyped after decorator transformation" after deferral (Stanislav Terliakov, PR [19591](https://github.com/python/mypy/pull/19591)) + * Reset to previous statement when leaving `return` in semanal (Stanislav Terliakov, PR [19642](https://github.com/python/mypy/pull/19642)) + * Include `ambiguous` into `UninhabitedType` identity (Stanislav Terliakov, PR [19648](https://github.com/python/mypy/pull/19648)) + * [mypyc] feat: exact_dict_set_item_op (BobTheBuidler, PR [19657](https://github.com/python/mypy/pull/19657)) + * chore: homogenize TypeGuard usage in rtypes.py (BobTheBuidler, PR [19655](https://github.com/python/mypy/pull/19655)) + * [mypyc] feat: cache len for iterating over immutable types (BobTheBuidler, PR [19656](https://github.com/python/mypy/pull/19656)) + * [mypyc] feat: stararg fastpath when calling fn(*args) with tuple (BobTheBuidler, PR [19623](https://github.com/python/mypy/pull/19623)) + * [mypyc] Include more operations in the trace log (Jukka Lehtosalo, PR [19647](https://github.com/python/mypy/pull/19647)) + * [mypyc] Fix remaining failing test on free-threaded builds (Jukka Lehtosalo, PR [19646](https://github.com/python/mypy/pull/19646)) + * Special-case enum method calls (Ivan Levkivskyi, PR [19634](https://github.com/python/mypy/pull/19634)) + * Another two micro-optimizations (Ivan Levkivskyi, PR [19633](https://github.com/python/mypy/pull/19633)) + * [mypyc] Add prefix to attributes of generator classes (Piotr Sawicki, PR [19535](https://github.com/python/mypy/pull/19535)) + * PEP 702 (@deprecated): handle "combined" overloads (Christoph Tyralla, PR [19626](https://github.com/python/mypy/pull/19626)) + * [mypyc] Fix seg fault due to heap type objects with static tp_doc (Brian Schubert, PR [19636](https://github.com/python/mypy/pull/19636)) + * Two more micro-optimizations (Ivan Levkivskyi, PR [19627](https://github.com/python/mypy/pull/19627)) + * Cache common instances (Ivan Levkivskyi, PR [19621](https://github.com/python/mypy/pull/19621)) + * Further fix overload diagnostic for vararg and varkwarg (Shantanu, PR [19619](https://github.com/python/mypy/pull/19619)) + * [mypyc] Provide instructions for resolving missing test module on Windows (Emma Smith, PR [19579](https://github.com/python/mypy/pull/19579)) + * Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19615)) + * PEP 702 (@deprecated): consider overloads in snapshot descriptions (Christoph Tyralla, PR [19613](https://github.com/python/mypy/pull/19613)) + * Fix overload diagnostic when vararg and varkwarg can match (Shantanu, PR [19614](https://github.com/python/mypy/pull/19614)) + * Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) + * Fix crash when using enable_error_code value of wrong type in pyproject.toml (wyattscarpenter, PR [19494](https://github.com/python/mypy/pull/19494)) + * Assorted niche optimizations (Ivan Levkivskyi, PR [19587](https://github.com/python/mypy/pull/19587)) + * Move Windows tests from oldest to newest version (Ivan Levkivskyi, PR [19545](https://github.com/python/mypy/pull/19545)) + * Skip more method bodies in third-party libraries (Ivan Levkivskyi, PR [19586](https://github.com/python/mypy/pull/19586)) + * Fix dict assignment to a wider context containing an incompatible typeddict of the same shape (Stanislav Terliakov, PR [19592](https://github.com/python/mypy/pull/19592)) + * [mypyc] Fix async mypyc tests on Windows (Emma Smith, PR [19578](https://github.com/python/mypy/pull/19578)) + * Fix `--package-root` tests for Windows and Python 3.13+ (Emma Smith, PR [19583](https://github.com/python/mypy/pull/19583)) + * Do not use dictionary in CallableType (Ivan Levkivskyi, PR [19580](https://github.com/python/mypy/pull/19580)) + * Remove --new-type-inference flag (Ivan Levkivskyi, PR [19570](https://github.com/python/mypy/pull/19570)) + * Recognize buffer protocol special methods (Brian Schubert, PR [19581](https://github.com/python/mypy/pull/19581)) + * Introduce temporary named expressions for `match` subjects (Stanislav Terliakov, PR [18446](https://github.com/python/mypy/pull/18446)) + * [mypyc] feat: unwrap NewType types to their base types for optimized code paths (BobTheBuidler, PR [19497](https://github.com/python/mypy/pull/19497)) + * Interpret bare ClassVar as inferred, not Any (Ivan Levkivskyi, PR [19573](https://github.com/python/mypy/pull/19573)) + * Support attribute access on enum members correctly (Stanislav Terliakov, PR [19422](https://github.com/python/mypy/pull/19422)) + * Follow-up after #19025: test and cleanup (Stanislav Terliakov, PR [19294](https://github.com/python/mypy/pull/19294)) + * Check slots assignments on self types (Stanislav Terliakov, PR [19332](https://github.com/python/mypy/pull/19332)) + * [docs] update information about reveal type & locals in common_issues (wyattscarpenter, PR [19059](https://github.com/python/mypy/pull/19059)) + * Fix a bug where inline configurations of error codes would lose their values if accompanied by another inline configuration (wyattscarpenter, PR [19075](https://github.com/python/mypy/pull/19075)) + * Mention in the Any documentation how object is preferable (wyattscarpenter, PR [19103](https://github.com/python/mypy/pull/19103)) + * [docs] Update common_issues.rst: mention orjson in the Mypy slow section (wyattscarpenter, PR [19058](https://github.com/python/mypy/pull/19058)) + * [docs] Include a real listing of the flags strict enables in the online documentation (wyattscarpenter, PR [19062](https://github.com/python/mypy/pull/19062)) + * [stubtest] Allow runtime-existing aliases of types marked as `@type_check_only` (Brian Schubert, PR [19568](https://github.com/python/mypy/pull/19568)) + * Add stubtest test for property aliases (Ali Hamdan, PR [19567](https://github.com/python/mypy/pull/19567)) + * Add internal flag to disable expression cache (Ivan Levkivskyi, PR [19569](https://github.com/python/mypy/pull/19569)) + * Update crash issue template to use syntax highlighting in code blocks (Brian Schubert, PR [19527](https://github.com/python/mypy/pull/19527)) + * Optimize bind_self() and deprecation checks (Ivan Levkivskyi, PR [19556](https://github.com/python/mypy/pull/19556)) + * fix: prevent crash on dataclass with PEP695 TypeVarTuple on py3.13 (Stanislav Terliakov, PR [19565](https://github.com/python/mypy/pull/19565)) + * Keep trivial instances and aliases during expansion (Ivan Levkivskyi, PR [19543](https://github.com/python/mypy/pull/19543)) + * feat: new mypyc primitive for weakref.ref (BobTheBuidler, PR [19099](https://github.com/python/mypy/pull/19099)) + * Explicitly check case‐sensitivity of file system for tests (Emily, PR [19540](https://github.com/python/mypy/pull/19540)) + * Update changelog for 1.17.1 (Shantanu, PR [19550](https://github.com/python/mypy/pull/19550)) + * Update test requirements (Marc Mueller, PR [19539](https://github.com/python/mypy/pull/19539)) + * [mypyc] Enable free threading when compiling multiple modules (Jukka Lehtosalo, PR [19541](https://github.com/python/mypy/pull/19541)) + * [mypyc] Make type objects immortal if using free threading (Jukka Lehtosalo, PR [19538](https://github.com/python/mypy/pull/19538)) + * Use cache for DictExpr as well (Ivan Levkivskyi, PR [19536](https://github.com/python/mypy/pull/19536)) + * Use cache for OpExpr (Ivan Levkivskyi, PR [19523](https://github.com/python/mypy/pull/19523)) + * perf: deduplicate `fast_container_type` and `fast_dict_type` items before joining (Stanislav Terliakov, PR [19409](https://github.com/python/mypy/pull/19409)) + * Move self argument checks to a later phase - after decorator application, if any (Stanislav Terliakov, PR [19490](https://github.com/python/mypy/pull/19490)) + * Try simple-minded call expression cache (Ivan Levkivskyi, PR [19505](https://github.com/python/mypy/pull/19505)) + * [mypyc] Fix list.pop primitive on free-threaded builds (Jukka Lehtosalo, PR [19522](https://github.com/python/mypy/pull/19522)) + * [mypyc] Only generate an export table if using separate compilation (Jukka Lehtosalo, PR [19521](https://github.com/python/mypy/pull/19521)) + * Various minor docstring and comment updates (Jukka Lehtosalo, PR [19519](https://github.com/python/mypy/pull/19519)) + * Cache type_object_type() (Ivan Levkivskyi, PR [19514](https://github.com/python/mypy/pull/19514)) + * Prevent final reassignment in match case (Omer Hadari, PR [19496](https://github.com/python/mypy/pull/19496)) + * Avoid duplicate visit in check_boolean_op() (Ivan Levkivskyi, PR [19515](https://github.com/python/mypy/pull/19515)) + * docs: update cython and setuptools RTD URLs (Stanislav Terliakov, PR [19512](https://github.com/python/mypy/pull/19512)) + * Optimize generic inference passes (Ivan Levkivskyi, PR [19501](https://github.com/python/mypy/pull/19501)) + * Use normalized tuples for fallback calculation (Stanislav Terliakov, PR [19111](https://github.com/python/mypy/pull/19111)) + * Fix decorated methods with self-types in protocols (Ivan Levkivskyi, PR [19484](https://github.com/python/mypy/pull/19484)) + * Uninhabited should have all attributes (Ivan Levkivskyi, PR [19300](https://github.com/python/mypy/pull/19300)) + * Micro-optimize type indirection visitor (Jukka Lehtosalo, PR [19460](https://github.com/python/mypy/pull/19460)) + * [mypyc] Add script to compile mypy with trace logging and run mypy (Jukka Lehtosalo, PR [19475](https://github.com/python/mypy/pull/19475)) + * Micro-optimize TypeTraverserVisitor (Jukka Lehtosalo, PR [19459](https://github.com/python/mypy/pull/19459)) + * Micro-optimize chained plugin (Jukka Lehtosalo, PR [19464](https://github.com/python/mypy/pull/19464)) + * Micro-optimize ExpandTypeVisitor (Jukka Lehtosalo, PR [19461](https://github.com/python/mypy/pull/19461)) + * Micro-optimization: Avoid temporary set creation in is_proper_subtype (Jukka Lehtosalo, PR [19463](https://github.com/python/mypy/pull/19463)) + * Speed up the default plugin (Jukka Lehtosalo, PR [19462](https://github.com/python/mypy/pull/19462)) + * perf: return from `is_subtype` early (Stanislav Terliakov, PR [19400](https://github.com/python/mypy/pull/19400)) + * [mypyc] Optionally log a sampled operation trace to a file (Jukka Lehtosalo, PR [19457](https://github.com/python/mypy/pull/19457)) + * [mypyc] Report error when registering a nested function (Piotr Sawicki, PR [19450](https://github.com/python/mypy/pull/19450)) + * [mypyc] Refactor: make LoadMem not borrow by default (Jukka Lehtosalo, PR [19445](https://github.com/python/mypy/pull/19445)) + * [mypyc] Add primitives for isinstance of built-in types (Piotr Sawicki, PR [19435](https://github.com/python/mypy/pull/19435)) + * [mypyc] Add SetElement op for initializing struct values (Jukka Lehtosalo, PR [19437](https://github.com/python/mypy/pull/19437)) + * [mypyc] Simplify IR generated for "for" loops over strings (Jukka Lehtosalo, PR [19434](https://github.com/python/mypy/pull/19434)) + * [mypyc] Use native integers for some sequence indexing operations (Jukka Lehtosalo, PR [19426](https://github.com/python/mypy/pull/19426)) + * [mypyc] Remove the unused CPyList_GetItemUnsafe primitive (Jukka Lehtosalo, PR [19424](https://github.com/python/mypy/pull/19424)) + * [mypyc] Add a few native int helper irbuilder methods (Jukka Lehtosalo, PR [19423](https://github.com/python/mypy/pull/19423)) + * Allow adjacent conditionally-defined overloads (Stanislav Terliakov, PR [19042](https://github.com/python/mypy/pull/19042)) + * [mypyc] Add back test for next with list iterator (Piotr Sawicki, PR [19419](https://github.com/python/mypy/pull/19419)) + * [mypyc] Fail run test if default driver does not find test cases (Piotr Sawicki, PR [19420](https://github.com/python/mypy/pull/19420)) + * Move `is_defined_in_stub` to shared checker API to break import cycle (Stanislav Terliakov, PR [19417](https://github.com/python/mypy/pull/19417)) + * [mypyc] Use PyList_Check for isinstance(obj, list) (Piotr Sawicki, PR [19416](https://github.com/python/mypy/pull/19416)) + * Infer empty list without annotation for `__slots__` and module `__all__` (Stanislav Terliakov, PR [19348](https://github.com/python/mypy/pull/19348)) + * Support `_value_` as a fallback for ellipsis Enum members (Stanislav Terliakov, PR [19352](https://github.com/python/mypy/pull/19352)) + * More shards for `mypy-primer` (Randolf Scholz, PR [19405](https://github.com/python/mypy/pull/19405)) + * [mypyc] Speed up for loop over native generator (Jukka Lehtosalo, PR [19415](https://github.com/python/mypy/pull/19415)) + * feat: add helpful info to internal AssertionError excs (BobTheBuidler, PR [19404](https://github.com/python/mypy/pull/19404)) + * [mypyc] Report error on reserved method name (Piotr Sawicki, PR [19407](https://github.com/python/mypy/pull/19407)) + * [mypyc] Add is_bool_or_bit_rprimitive (Piotr Sawicki, PR [19406](https://github.com/python/mypy/pull/19406)) + * [mypyc] Add faster primitive for string equality (Jukka Lehtosalo, PR [19402](https://github.com/python/mypy/pull/19402)) + * [mypyc] Speed up native-to-native calls using await (Jukka Lehtosalo, PR [19398](https://github.com/python/mypy/pull/19398)) + * [mypyc] Add tests for string equality (Jukka Lehtosalo, PR [19401](https://github.com/python/mypy/pull/19401)) + * [mypyc] Raise NameError on undefined names (Piotr Sawicki, PR [19395](https://github.com/python/mypy/pull/19395)) + * [mypyc] Simplify comparison of tuple elements (Piotr Sawicki, PR [19396](https://github.com/python/mypy/pull/19396)) + * perf: add `__slots__` to `SubtypeVisitor` (Stanislav Terliakov, PR [19394](https://github.com/python/mypy/pull/19394)) + * Improve the support for promotions inside unions (Christoph Tyralla, PR [19245](https://github.com/python/mypy/pull/19245)) + * [mypyc] Use per-type free "lists" for nested functions (Jukka Lehtosalo, PR [19390](https://github.com/python/mypy/pull/19390)) + * [mypyc] Call generator helper method directly in await expression (Jukka Lehtosalo, PR [19376](https://github.com/python/mypy/pull/19376)) + * [mypyc] Generate introspection signatures for compiled functions (Brian Schubert, PR [19307](https://github.com/python/mypy/pull/19307)) + * [mypyc] Add support for C string literals in the IR (Jukka Lehtosalo, PR [19383](https://github.com/python/mypy/pull/19383)) + * [mypyc] Fix error value check for GetAttr that allows nullable values (Jukka Lehtosalo, PR [19378](https://github.com/python/mypy/pull/19378)) + * Check property decorators stricter (Stanislav Terliakov, PR [19313](https://github.com/python/mypy/pull/19313)) + * Remove all nested imports from default plugin (Ivan Levkivskyi, PR [19388](https://github.com/python/mypy/pull/19388)) + * Speed up the default plugin (Jukka Lehtosalo, PR [19385](https://github.com/python/mypy/pull/19385)) + * Subtype checking micro-optimization (Jukka Lehtosalo, PR [19384](https://github.com/python/mypy/pull/19384)) + * Support type checking code fragment in profile script (Jukka Lehtosalo, PR [19379](https://github.com/python/mypy/pull/19379)) + * [mypyc] Fix comparison of tuples with different lengths (Piotr Sawicki, PR [19372](https://github.com/python/mypy/pull/19372)) + * [mypyc] Document some of our inheritance conventions (Jukka Lehtosalo, PR [19370](https://github.com/python/mypy/pull/19370)) + * [mypyc] Speed up generator allocation by using a per-type freelist (Jukka Lehtosalo, PR [19316](https://github.com/python/mypy/pull/19316)) + * feat: new mypyc primitives for str.count (BobTheBuidler, PR [19264](https://github.com/python/mypy/pull/19264)) + * [mypyc] Implement `list.clear()` primitive (Jahongir Qurbonov, PR [19344](https://github.com/python/mypy/pull/19344)) + * Metaclass conflict check improvements (Robsdedude, PR [17682](https://github.com/python/mypy/pull/17682)) + * Do not show protocol compatibility note against unpacked sequence or mapping (Stanislav Terliakov, PR [19358](https://github.com/python/mypy/pull/19358)) + * Remove unnecessary workarounds from bind_self() (Ivan Levkivskyi, PR [19356](https://github.com/python/mypy/pull/19356)) + * Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) + * Fix C compiler flags in the profile self check script (Jukka Lehtosalo, PR [19326](https://github.com/python/mypy/pull/19326)) + * Add script for profiling self check (Linux only) (Jukka Lehtosalo, PR [19322](https://github.com/python/mypy/pull/19322)) + * Avoid erasing type objects when checking runtime cover (Shantanu, PR [19320](https://github.com/python/mypy/pull/19320)) + * Fix `TypeGuard`/`TypeIs` being forgotten when semanal defers (Brian Schubert, PR [19325](https://github.com/python/mypy/pull/19325)) + * Fix incorrect signature suggestion from `dmypy suggest` when type name matches imported module name (Brian Schubert, PR [18937](https://github.com/python/mypy/pull/18937)) + * Speed up type checking by caching argument inference context (Jukka Lehtosalo, PR [19323](https://github.com/python/mypy/pull/19323)) + * Fix `TypeIs` negative narrowing of union of generics (Brian Schubert, PR [18193](https://github.com/python/mypy/pull/18193)) + * Tweaks to perf_compare.py script to reduce RAM usage (Jukka Lehtosalo, PR [19321](https://github.com/python/mypy/pull/19321)) + * Fix nit in documentation example (Daniel Hnyk) + * Ignore overload impl when checking __OP__ and __rOP__ compatibility (Stanislav Terliakov, PR [18502](https://github.com/python/mypy/pull/18502)) + * Support running stubtest in non-UTF8 terminals (Stanislav Terliakov, PR [19085](https://github.com/python/mypy/pull/19085)) + * Fix metaclass resolution algorithm (Robsdedude, PR [17713](https://github.com/python/mypy/pull/17713)) + * [mypyc] feat(docs): detail issue with inspect.iscoroutinefunction (BobTheBuidler, PR [19309](https://github.com/python/mypy/pull/19309)) + * Re-widen custom properties after narrowing (Ivan Levkivskyi, PR [19296](https://github.com/python/mypy/pull/19296)) + * Cleanup generic class variable access (Ivan Levkivskyi, PR [19292](https://github.com/python/mypy/pull/19292)) + * Fix constructor type for subclasses of Any (Ivan Levkivskyi, PR [19295](https://github.com/python/mypy/pull/19295)) + * Generalize class/static method and property alias support (Ivan Levkivskyi, PR [19297](https://github.com/python/mypy/pull/19297)) + * Fix `dmypy suggest` interaction with `__new__` (Stanislav Terliakov, PR [18966](https://github.com/python/mypy/pull/18966)) + * Show name of type variable in "Cannot infer type argument" message (Brian Schubert, PR [19290](https://github.com/python/mypy/pull/19290)) + * Fix missing error when redeclaring type variable in nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) + * support Callable / callable Protocols in suggest decorator unwarpping (Anthony Sottile, PR [19072](https://github.com/python/mypy/pull/19072)) + * Include tuple fallback in constraints built from tuple types (Stanislav Terliakov, PR [19100](https://github.com/python/mypy/pull/19100)) + * Skip existing when retrying upload-pypi.py (Jukka Lehtosalo, PR [19305](https://github.com/python/mypy/pull/19305)) + * Support properties with generic setters (Ivan Levkivskyi, PR [19298](https://github.com/python/mypy/pull/19298)) + * Fix tests in master (Ivan Levkivskyi, PR [19293](https://github.com/python/mypy/pull/19293)) + * Use union of current context and left side for right side narrowing of binary ops (Stanislav Terliakov, PR [19249](https://github.com/python/mypy/pull/19249)) + * Preserve literals when joining Literal and Instance with matching last_known_value (Stanislav Terliakov, PR [19279](https://github.com/python/mypy/pull/19279)) + * Bind self-types in checkmember for decorated classmethods (Stanislav Terliakov, PR [19025](https://github.com/python/mypy/pull/19025)) + +### Acknowledgements + +Thanks to all mypy contributors who contributed to this release: + +- Ali Hamdan +- Anthony Sottile +- BobTheBuidler +- Brian Schubert +- Chainfire +- Charlie Denton +- Christoph Tyralla +- CoolCat467 +- Daniel Hnyk +- Emily +- Emma Smith +- Ethan Sarp +- Ivan Levkivskyi +- Jahongir Qurbonov +- Jelle Zijlstra +- Joren Hammudoglu +- Jukka Lehtosalo +- Marc Mueller +- Omer Hadari +- Piotr Sawicki +- PrinceNaroliya +- Randolf Scholz +- Robsdedude +- Saul Shanabrook +- Shantanu +- Stanislav Terliakov +- Stephen Morton +- wyattscarpenter + +I’d also like to thank my employer, Dropbox, for supporting mypy development. + ## Mypy 1.17 We’ve just uploaded mypy 1.17 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). From e03c007793806cda07c796e16d2ed8a3ea4ad10c Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 03:43:15 -0400 Subject: [PATCH 02/10] added typeshed --- CHANGELOG.md | 411 ++++++++++++++++++++++++--------------------------- 1 file changed, 197 insertions(+), 214 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8740880327e5..e8cb9b77fa31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,220 +12,203 @@ You can install it as follows: You can read the full documentation for this release on [Read the Docs](http://mypy.readthedocs.io). - * [mypyc] Fix subclass processing in detect_undefined_bitmap (Chainfire, PR [19787](https://github.com/python/mypy/pull/19787)) - * feat: new mypyc primitives for weakref.proxy (BobTheBuidler, PR [19217](https://github.com/python/mypy/pull/19217)) - * Make --allow-redefinition-new argument public (Ivan Levkivskyi, PR [19796](https://github.com/python/mypy/pull/19796)) - * [stubtest] temporary `--ignore-disjoint-bases` flag (Joren Hammudoglu, PR [19740](https://github.com/python/mypy/pull/19740)) - * [mypyc] Fix C function signature (Jukka Lehtosalo, PR [19773](https://github.com/python/mypy/pull/19773)) - * Mypy micro-optimizations (batch 3/3) (Jukka Lehtosalo, PR [19770](https://github.com/python/mypy/pull/19770)) - * Use empty context as fallback for return statements (Ivan Levkivskyi, PR [19767](https://github.com/python/mypy/pull/19767)) - * Update stubinfo for latest typeshed (Shantanu, PR [19771](https://github.com/python/mypy/pull/19771)) - * Mypy micro-optimizations (batch 2/3) (Jukka Lehtosalo, PR [19769](https://github.com/python/mypy/pull/19769)) - * Mypy micro-optimizations (batch 1/3) (Jukka Lehtosalo, PR [19768](https://github.com/python/mypy/pull/19768)) - * Use fast Python wrappers in native_internal (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765)) - * Try fixing test times after GC hack (Ivan Levkivskyi, PR [19766](https://github.com/python/mypy/pull/19766)) - * Use some macros in native_internal (Ivan Levkivskyi, PR [19757](https://github.com/python/mypy/pull/19757)) - * Add idlemypyextension to IDE integrations section (CoolCat467, PR [18615](https://github.com/python/mypy/pull/18615)) - * `--strict-equality` for `None` (Christoph Tyralla, PR [19718](https://github.com/python/mypy/pull/19718)) - * Do not display import-related errors after module-level always false assert (Stanislav Terliakov, PR [19347](https://github.com/python/mypy/pull/19347)) - * Fix forward references in type parameters of overparameterized PEP 695 type aliases (Brian Schubert, PR [19725](https://github.com/python/mypy/pull/19725)) - * [mypyc] Use defined __new__ method in tp_new and constructor (Piotr Sawicki, PR [19739](https://github.com/python/mypy/pull/19739)) - * [mypyc] Speed up implicit __ne__ method (Jukka Lehtosalo, PR [19759](https://github.com/python/mypy/pull/19759)) - * [mypyc] Speed up equality with optional str/bytes types (Jukka Lehtosalo, PR [19758](https://github.com/python/mypy/pull/19758)) - * [mypyc] Refactor IR build of equality and unary operators (Jukka Lehtosalo, PR [19756](https://github.com/python/mypy/pull/19756)) - * Use more compact cache representation for int and str (Ivan Levkivskyi, PR [19750](https://github.com/python/mypy/pull/19750)) - * Fix crash with variadic tuple arguments to generic type (Randolf Scholz, PR [19705](https://github.com/python/mypy/pull/19705)) - * Don't write constructor cache without strict optional (Ivan Levkivskyi, PR [19752](https://github.com/python/mypy/pull/19752)) - * Do not use outer context for `or` expr inference if the LHS has Any (Stanislav Terliakov, PR [19748](https://github.com/python/mypy/pull/19748)) - * Use u8 for type/symbol tags (Ivan Levkivskyi, PR [19741](https://github.com/python/mypy/pull/19741)) - * [mypyc] feat: `__mypyc_empty_tuple__` constant (BobTheBuidler, PR [19654](https://github.com/python/mypy/pull/19654)) - * Cleanup old ast classes in fastparse (Marc Mueller, PR [19743](https://github.com/python/mypy/pull/19743)) - * Fix unwrapping assignment expressions in match subject (Marc Mueller, PR [19742](https://github.com/python/mypy/pull/19742)) - * Use 1 byte per type/symbol tag (Ivan Levkivskyi, PR [19735](https://github.com/python/mypy/pull/19735)) - * [mypyc] feat: PyObject_CallObject op for fn(*args) fastpath (BobTheBuidler, PR [19631](https://github.com/python/mypy/pull/19631)) - * Omit errors for class pattern matches against object (Marc Mueller, PR [19709](https://github.com/python/mypy/pull/19709)) - * Revert "Enable colored output for argparse help in Python 3.14 (#19021)" (Marc Mueller, PR [19721](https://github.com/python/mypy/pull/19721)) - * Update dependencies (Marc Mueller, PR [19720](https://github.com/python/mypy/pull/19720)) - * Include base mypy requirements in docs requirements (Brian Schubert, PR [19727](https://github.com/python/mypy/pull/19727)) - * More detailed checking of type objects in stubtest (Stephen Morton, PR [18251](https://github.com/python/mypy/pull/18251)) - * Remove unnecessary error message for match class patterns (Marc Mueller, PR [19708](https://github.com/python/mypy/pull/19708)) - * stubtest: handle overloads with mixed pos-only params (Stephen Morton, PR [18287](https://github.com/python/mypy/pull/18287)) - * Somewhat better support for isinstance on old-style unions (Shantanu, PR [19714](https://github.com/python/mypy/pull/19714)) - * Use union for captured vars in or pattern (Marc Mueller, PR [19710](https://github.com/python/mypy/pull/19710)) - * stubtest: flag redundant @disjoint_base decorators (Jelle Zijlstra, PR [19715](https://github.com/python/mypy/pull/19715)) - * stubtest: correct "argument" → "parameter" terminology in error messages (PrinceNaroliya, PR [19707](https://github.com/python/mypy/pull/19707)) - * stubtest: get better signatures for `__init__` of C classes (Stephen Morton, PR [18259](https://github.com/python/mypy/pull/18259)) - * stubtest: do not require @disjoint_base if there are __slots__ (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) - * [mypyc] feat: extend stararg fastpath from #19629 with star2 fastpath (BobTheBuidler, PR [19630](https://github.com/python/mypy/pull/19630)) - * Fail gracefully on unsupported template strings (PEP 750) (Brian Schubert, PR [19700](https://github.com/python/mypy/pull/19700)) - * Don't expand PEP 695 aliases when checking node fullnames (Brian Schubert, PR [19699](https://github.com/python/mypy/pull/19699)) - * More efficient (fixed-format) serialization (Ivan Levkivskyi, PR [19668](https://github.com/python/mypy/pull/19668)) - * Implement PEP 800 (@disjoint_base) (Jelle Zijlstra, PR [19678](https://github.com/python/mypy/pull/19678)) - * [mypyc] Optimize type(x) and x.__class__ (Jukka Lehtosalo, PR [19691](https://github.com/python/mypy/pull/19691)) - * [mypyc] Specialize bytes.decode calls with common encodings (Jukka Lehtosalo, PR [19688](https://github.com/python/mypy/pull/19688)) - * Force all deserialized objects to the oldest GC generation (Ivan Levkivskyi, PR [19681](https://github.com/python/mypy/pull/19681)) - * [mypyc] feat: extend stararg fastpath from #19623 to handle lists and generic sequences (BobTheBuidler, PR [19629](https://github.com/python/mypy/pull/19629)) - * [mypyc] Add primitive for .__name__ (Jukka Lehtosalo, PR [19683](https://github.com/python/mypy/pull/19683)) - * [mypyc] Speed up "in" against final fixed-length tuple (Jukka Lehtosalo, PR [19682](https://github.com/python/mypy/pull/19682)) - * [mypyc] Refactor building IR for "in" against a tuple (Jukka Lehtosalo, PR [19679](https://github.com/python/mypy/pull/19679)) - * Sort arguments in TypedDict overlap error message (Marc Mueller, PR [19666](https://github.com/python/mypy/pull/19666)) - * [mypyc] Remove unreachable code (Jukka Lehtosalo, PR [19667](https://github.com/python/mypy/pull/19667)) - * [mypyc] feat: optimize f-string building from Final values (BobTheBuidler, PR [19611](https://github.com/python/mypy/pull/19611)) - * fix: prevent false positive "untyped after decorator transformation" after deferral (Stanislav Terliakov, PR [19591](https://github.com/python/mypy/pull/19591)) - * Reset to previous statement when leaving `return` in semanal (Stanislav Terliakov, PR [19642](https://github.com/python/mypy/pull/19642)) - * Include `ambiguous` into `UninhabitedType` identity (Stanislav Terliakov, PR [19648](https://github.com/python/mypy/pull/19648)) - * [mypyc] feat: exact_dict_set_item_op (BobTheBuidler, PR [19657](https://github.com/python/mypy/pull/19657)) - * chore: homogenize TypeGuard usage in rtypes.py (BobTheBuidler, PR [19655](https://github.com/python/mypy/pull/19655)) - * [mypyc] feat: cache len for iterating over immutable types (BobTheBuidler, PR [19656](https://github.com/python/mypy/pull/19656)) - * [mypyc] feat: stararg fastpath when calling fn(*args) with tuple (BobTheBuidler, PR [19623](https://github.com/python/mypy/pull/19623)) - * [mypyc] Include more operations in the trace log (Jukka Lehtosalo, PR [19647](https://github.com/python/mypy/pull/19647)) - * [mypyc] Fix remaining failing test on free-threaded builds (Jukka Lehtosalo, PR [19646](https://github.com/python/mypy/pull/19646)) - * Special-case enum method calls (Ivan Levkivskyi, PR [19634](https://github.com/python/mypy/pull/19634)) - * Another two micro-optimizations (Ivan Levkivskyi, PR [19633](https://github.com/python/mypy/pull/19633)) - * [mypyc] Add prefix to attributes of generator classes (Piotr Sawicki, PR [19535](https://github.com/python/mypy/pull/19535)) - * PEP 702 (@deprecated): handle "combined" overloads (Christoph Tyralla, PR [19626](https://github.com/python/mypy/pull/19626)) - * [mypyc] Fix seg fault due to heap type objects with static tp_doc (Brian Schubert, PR [19636](https://github.com/python/mypy/pull/19636)) - * Two more micro-optimizations (Ivan Levkivskyi, PR [19627](https://github.com/python/mypy/pull/19627)) - * Cache common instances (Ivan Levkivskyi, PR [19621](https://github.com/python/mypy/pull/19621)) - * Further fix overload diagnostic for vararg and varkwarg (Shantanu, PR [19619](https://github.com/python/mypy/pull/19619)) - * [mypyc] Provide instructions for resolving missing test module on Windows (Emma Smith, PR [19579](https://github.com/python/mypy/pull/19579)) - * Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19615)) - * PEP 702 (@deprecated): consider overloads in snapshot descriptions (Christoph Tyralla, PR [19613](https://github.com/python/mypy/pull/19613)) - * Fix overload diagnostic when vararg and varkwarg can match (Shantanu, PR [19614](https://github.com/python/mypy/pull/19614)) - * Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) - * Fix crash when using enable_error_code value of wrong type in pyproject.toml (wyattscarpenter, PR [19494](https://github.com/python/mypy/pull/19494)) - * Assorted niche optimizations (Ivan Levkivskyi, PR [19587](https://github.com/python/mypy/pull/19587)) - * Move Windows tests from oldest to newest version (Ivan Levkivskyi, PR [19545](https://github.com/python/mypy/pull/19545)) - * Skip more method bodies in third-party libraries (Ivan Levkivskyi, PR [19586](https://github.com/python/mypy/pull/19586)) - * Fix dict assignment to a wider context containing an incompatible typeddict of the same shape (Stanislav Terliakov, PR [19592](https://github.com/python/mypy/pull/19592)) - * [mypyc] Fix async mypyc tests on Windows (Emma Smith, PR [19578](https://github.com/python/mypy/pull/19578)) - * Fix `--package-root` tests for Windows and Python 3.13+ (Emma Smith, PR [19583](https://github.com/python/mypy/pull/19583)) - * Do not use dictionary in CallableType (Ivan Levkivskyi, PR [19580](https://github.com/python/mypy/pull/19580)) - * Remove --new-type-inference flag (Ivan Levkivskyi, PR [19570](https://github.com/python/mypy/pull/19570)) - * Recognize buffer protocol special methods (Brian Schubert, PR [19581](https://github.com/python/mypy/pull/19581)) - * Introduce temporary named expressions for `match` subjects (Stanislav Terliakov, PR [18446](https://github.com/python/mypy/pull/18446)) - * [mypyc] feat: unwrap NewType types to their base types for optimized code paths (BobTheBuidler, PR [19497](https://github.com/python/mypy/pull/19497)) - * Interpret bare ClassVar as inferred, not Any (Ivan Levkivskyi, PR [19573](https://github.com/python/mypy/pull/19573)) - * Support attribute access on enum members correctly (Stanislav Terliakov, PR [19422](https://github.com/python/mypy/pull/19422)) - * Follow-up after #19025: test and cleanup (Stanislav Terliakov, PR [19294](https://github.com/python/mypy/pull/19294)) - * Check slots assignments on self types (Stanislav Terliakov, PR [19332](https://github.com/python/mypy/pull/19332)) - * [docs] update information about reveal type & locals in common_issues (wyattscarpenter, PR [19059](https://github.com/python/mypy/pull/19059)) - * Fix a bug where inline configurations of error codes would lose their values if accompanied by another inline configuration (wyattscarpenter, PR [19075](https://github.com/python/mypy/pull/19075)) - * Mention in the Any documentation how object is preferable (wyattscarpenter, PR [19103](https://github.com/python/mypy/pull/19103)) - * [docs] Update common_issues.rst: mention orjson in the Mypy slow section (wyattscarpenter, PR [19058](https://github.com/python/mypy/pull/19058)) - * [docs] Include a real listing of the flags strict enables in the online documentation (wyattscarpenter, PR [19062](https://github.com/python/mypy/pull/19062)) - * [stubtest] Allow runtime-existing aliases of types marked as `@type_check_only` (Brian Schubert, PR [19568](https://github.com/python/mypy/pull/19568)) - * Add stubtest test for property aliases (Ali Hamdan, PR [19567](https://github.com/python/mypy/pull/19567)) - * Add internal flag to disable expression cache (Ivan Levkivskyi, PR [19569](https://github.com/python/mypy/pull/19569)) - * Update crash issue template to use syntax highlighting in code blocks (Brian Schubert, PR [19527](https://github.com/python/mypy/pull/19527)) - * Optimize bind_self() and deprecation checks (Ivan Levkivskyi, PR [19556](https://github.com/python/mypy/pull/19556)) - * fix: prevent crash on dataclass with PEP695 TypeVarTuple on py3.13 (Stanislav Terliakov, PR [19565](https://github.com/python/mypy/pull/19565)) - * Keep trivial instances and aliases during expansion (Ivan Levkivskyi, PR [19543](https://github.com/python/mypy/pull/19543)) - * feat: new mypyc primitive for weakref.ref (BobTheBuidler, PR [19099](https://github.com/python/mypy/pull/19099)) - * Explicitly check case‐sensitivity of file system for tests (Emily, PR [19540](https://github.com/python/mypy/pull/19540)) - * Update changelog for 1.17.1 (Shantanu, PR [19550](https://github.com/python/mypy/pull/19550)) - * Update test requirements (Marc Mueller, PR [19539](https://github.com/python/mypy/pull/19539)) - * [mypyc] Enable free threading when compiling multiple modules (Jukka Lehtosalo, PR [19541](https://github.com/python/mypy/pull/19541)) - * [mypyc] Make type objects immortal if using free threading (Jukka Lehtosalo, PR [19538](https://github.com/python/mypy/pull/19538)) - * Use cache for DictExpr as well (Ivan Levkivskyi, PR [19536](https://github.com/python/mypy/pull/19536)) - * Use cache for OpExpr (Ivan Levkivskyi, PR [19523](https://github.com/python/mypy/pull/19523)) - * perf: deduplicate `fast_container_type` and `fast_dict_type` items before joining (Stanislav Terliakov, PR [19409](https://github.com/python/mypy/pull/19409)) - * Move self argument checks to a later phase - after decorator application, if any (Stanislav Terliakov, PR [19490](https://github.com/python/mypy/pull/19490)) - * Try simple-minded call expression cache (Ivan Levkivskyi, PR [19505](https://github.com/python/mypy/pull/19505)) - * [mypyc] Fix list.pop primitive on free-threaded builds (Jukka Lehtosalo, PR [19522](https://github.com/python/mypy/pull/19522)) - * [mypyc] Only generate an export table if using separate compilation (Jukka Lehtosalo, PR [19521](https://github.com/python/mypy/pull/19521)) - * Various minor docstring and comment updates (Jukka Lehtosalo, PR [19519](https://github.com/python/mypy/pull/19519)) - * Cache type_object_type() (Ivan Levkivskyi, PR [19514](https://github.com/python/mypy/pull/19514)) - * Prevent final reassignment in match case (Omer Hadari, PR [19496](https://github.com/python/mypy/pull/19496)) - * Avoid duplicate visit in check_boolean_op() (Ivan Levkivskyi, PR [19515](https://github.com/python/mypy/pull/19515)) - * docs: update cython and setuptools RTD URLs (Stanislav Terliakov, PR [19512](https://github.com/python/mypy/pull/19512)) - * Optimize generic inference passes (Ivan Levkivskyi, PR [19501](https://github.com/python/mypy/pull/19501)) - * Use normalized tuples for fallback calculation (Stanislav Terliakov, PR [19111](https://github.com/python/mypy/pull/19111)) - * Fix decorated methods with self-types in protocols (Ivan Levkivskyi, PR [19484](https://github.com/python/mypy/pull/19484)) - * Uninhabited should have all attributes (Ivan Levkivskyi, PR [19300](https://github.com/python/mypy/pull/19300)) - * Micro-optimize type indirection visitor (Jukka Lehtosalo, PR [19460](https://github.com/python/mypy/pull/19460)) - * [mypyc] Add script to compile mypy with trace logging and run mypy (Jukka Lehtosalo, PR [19475](https://github.com/python/mypy/pull/19475)) - * Micro-optimize TypeTraverserVisitor (Jukka Lehtosalo, PR [19459](https://github.com/python/mypy/pull/19459)) - * Micro-optimize chained plugin (Jukka Lehtosalo, PR [19464](https://github.com/python/mypy/pull/19464)) - * Micro-optimize ExpandTypeVisitor (Jukka Lehtosalo, PR [19461](https://github.com/python/mypy/pull/19461)) - * Micro-optimization: Avoid temporary set creation in is_proper_subtype (Jukka Lehtosalo, PR [19463](https://github.com/python/mypy/pull/19463)) - * Speed up the default plugin (Jukka Lehtosalo, PR [19462](https://github.com/python/mypy/pull/19462)) - * perf: return from `is_subtype` early (Stanislav Terliakov, PR [19400](https://github.com/python/mypy/pull/19400)) - * [mypyc] Optionally log a sampled operation trace to a file (Jukka Lehtosalo, PR [19457](https://github.com/python/mypy/pull/19457)) - * [mypyc] Report error when registering a nested function (Piotr Sawicki, PR [19450](https://github.com/python/mypy/pull/19450)) - * [mypyc] Refactor: make LoadMem not borrow by default (Jukka Lehtosalo, PR [19445](https://github.com/python/mypy/pull/19445)) - * [mypyc] Add primitives for isinstance of built-in types (Piotr Sawicki, PR [19435](https://github.com/python/mypy/pull/19435)) - * [mypyc] Add SetElement op for initializing struct values (Jukka Lehtosalo, PR [19437](https://github.com/python/mypy/pull/19437)) - * [mypyc] Simplify IR generated for "for" loops over strings (Jukka Lehtosalo, PR [19434](https://github.com/python/mypy/pull/19434)) - * [mypyc] Use native integers for some sequence indexing operations (Jukka Lehtosalo, PR [19426](https://github.com/python/mypy/pull/19426)) - * [mypyc] Remove the unused CPyList_GetItemUnsafe primitive (Jukka Lehtosalo, PR [19424](https://github.com/python/mypy/pull/19424)) - * [mypyc] Add a few native int helper irbuilder methods (Jukka Lehtosalo, PR [19423](https://github.com/python/mypy/pull/19423)) - * Allow adjacent conditionally-defined overloads (Stanislav Terliakov, PR [19042](https://github.com/python/mypy/pull/19042)) - * [mypyc] Add back test for next with list iterator (Piotr Sawicki, PR [19419](https://github.com/python/mypy/pull/19419)) - * [mypyc] Fail run test if default driver does not find test cases (Piotr Sawicki, PR [19420](https://github.com/python/mypy/pull/19420)) - * Move `is_defined_in_stub` to shared checker API to break import cycle (Stanislav Terliakov, PR [19417](https://github.com/python/mypy/pull/19417)) - * [mypyc] Use PyList_Check for isinstance(obj, list) (Piotr Sawicki, PR [19416](https://github.com/python/mypy/pull/19416)) - * Infer empty list without annotation for `__slots__` and module `__all__` (Stanislav Terliakov, PR [19348](https://github.com/python/mypy/pull/19348)) - * Support `_value_` as a fallback for ellipsis Enum members (Stanislav Terliakov, PR [19352](https://github.com/python/mypy/pull/19352)) - * More shards for `mypy-primer` (Randolf Scholz, PR [19405](https://github.com/python/mypy/pull/19405)) - * [mypyc] Speed up for loop over native generator (Jukka Lehtosalo, PR [19415](https://github.com/python/mypy/pull/19415)) - * feat: add helpful info to internal AssertionError excs (BobTheBuidler, PR [19404](https://github.com/python/mypy/pull/19404)) - * [mypyc] Report error on reserved method name (Piotr Sawicki, PR [19407](https://github.com/python/mypy/pull/19407)) - * [mypyc] Add is_bool_or_bit_rprimitive (Piotr Sawicki, PR [19406](https://github.com/python/mypy/pull/19406)) - * [mypyc] Add faster primitive for string equality (Jukka Lehtosalo, PR [19402](https://github.com/python/mypy/pull/19402)) - * [mypyc] Speed up native-to-native calls using await (Jukka Lehtosalo, PR [19398](https://github.com/python/mypy/pull/19398)) - * [mypyc] Add tests for string equality (Jukka Lehtosalo, PR [19401](https://github.com/python/mypy/pull/19401)) - * [mypyc] Raise NameError on undefined names (Piotr Sawicki, PR [19395](https://github.com/python/mypy/pull/19395)) - * [mypyc] Simplify comparison of tuple elements (Piotr Sawicki, PR [19396](https://github.com/python/mypy/pull/19396)) - * perf: add `__slots__` to `SubtypeVisitor` (Stanislav Terliakov, PR [19394](https://github.com/python/mypy/pull/19394)) - * Improve the support for promotions inside unions (Christoph Tyralla, PR [19245](https://github.com/python/mypy/pull/19245)) - * [mypyc] Use per-type free "lists" for nested functions (Jukka Lehtosalo, PR [19390](https://github.com/python/mypy/pull/19390)) - * [mypyc] Call generator helper method directly in await expression (Jukka Lehtosalo, PR [19376](https://github.com/python/mypy/pull/19376)) - * [mypyc] Generate introspection signatures for compiled functions (Brian Schubert, PR [19307](https://github.com/python/mypy/pull/19307)) - * [mypyc] Add support for C string literals in the IR (Jukka Lehtosalo, PR [19383](https://github.com/python/mypy/pull/19383)) - * [mypyc] Fix error value check for GetAttr that allows nullable values (Jukka Lehtosalo, PR [19378](https://github.com/python/mypy/pull/19378)) - * Check property decorators stricter (Stanislav Terliakov, PR [19313](https://github.com/python/mypy/pull/19313)) - * Remove all nested imports from default plugin (Ivan Levkivskyi, PR [19388](https://github.com/python/mypy/pull/19388)) - * Speed up the default plugin (Jukka Lehtosalo, PR [19385](https://github.com/python/mypy/pull/19385)) - * Subtype checking micro-optimization (Jukka Lehtosalo, PR [19384](https://github.com/python/mypy/pull/19384)) - * Support type checking code fragment in profile script (Jukka Lehtosalo, PR [19379](https://github.com/python/mypy/pull/19379)) - * [mypyc] Fix comparison of tuples with different lengths (Piotr Sawicki, PR [19372](https://github.com/python/mypy/pull/19372)) - * [mypyc] Document some of our inheritance conventions (Jukka Lehtosalo, PR [19370](https://github.com/python/mypy/pull/19370)) - * [mypyc] Speed up generator allocation by using a per-type freelist (Jukka Lehtosalo, PR [19316](https://github.com/python/mypy/pull/19316)) - * feat: new mypyc primitives for str.count (BobTheBuidler, PR [19264](https://github.com/python/mypy/pull/19264)) - * [mypyc] Implement `list.clear()` primitive (Jahongir Qurbonov, PR [19344](https://github.com/python/mypy/pull/19344)) - * Metaclass conflict check improvements (Robsdedude, PR [17682](https://github.com/python/mypy/pull/17682)) - * Do not show protocol compatibility note against unpacked sequence or mapping (Stanislav Terliakov, PR [19358](https://github.com/python/mypy/pull/19358)) - * Remove unnecessary workarounds from bind_self() (Ivan Levkivskyi, PR [19356](https://github.com/python/mypy/pull/19356)) - * Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) - * Fix C compiler flags in the profile self check script (Jukka Lehtosalo, PR [19326](https://github.com/python/mypy/pull/19326)) - * Add script for profiling self check (Linux only) (Jukka Lehtosalo, PR [19322](https://github.com/python/mypy/pull/19322)) - * Avoid erasing type objects when checking runtime cover (Shantanu, PR [19320](https://github.com/python/mypy/pull/19320)) - * Fix `TypeGuard`/`TypeIs` being forgotten when semanal defers (Brian Schubert, PR [19325](https://github.com/python/mypy/pull/19325)) - * Fix incorrect signature suggestion from `dmypy suggest` when type name matches imported module name (Brian Schubert, PR [18937](https://github.com/python/mypy/pull/18937)) - * Speed up type checking by caching argument inference context (Jukka Lehtosalo, PR [19323](https://github.com/python/mypy/pull/19323)) - * Fix `TypeIs` negative narrowing of union of generics (Brian Schubert, PR [18193](https://github.com/python/mypy/pull/18193)) - * Tweaks to perf_compare.py script to reduce RAM usage (Jukka Lehtosalo, PR [19321](https://github.com/python/mypy/pull/19321)) - * Fix nit in documentation example (Daniel Hnyk) - * Ignore overload impl when checking __OP__ and __rOP__ compatibility (Stanislav Terliakov, PR [18502](https://github.com/python/mypy/pull/18502)) - * Support running stubtest in non-UTF8 terminals (Stanislav Terliakov, PR [19085](https://github.com/python/mypy/pull/19085)) - * Fix metaclass resolution algorithm (Robsdedude, PR [17713](https://github.com/python/mypy/pull/17713)) - * [mypyc] feat(docs): detail issue with inspect.iscoroutinefunction (BobTheBuidler, PR [19309](https://github.com/python/mypy/pull/19309)) - * Re-widen custom properties after narrowing (Ivan Levkivskyi, PR [19296](https://github.com/python/mypy/pull/19296)) - * Cleanup generic class variable access (Ivan Levkivskyi, PR [19292](https://github.com/python/mypy/pull/19292)) - * Fix constructor type for subclasses of Any (Ivan Levkivskyi, PR [19295](https://github.com/python/mypy/pull/19295)) - * Generalize class/static method and property alias support (Ivan Levkivskyi, PR [19297](https://github.com/python/mypy/pull/19297)) - * Fix `dmypy suggest` interaction with `__new__` (Stanislav Terliakov, PR [18966](https://github.com/python/mypy/pull/18966)) - * Show name of type variable in "Cannot infer type argument" message (Brian Schubert, PR [19290](https://github.com/python/mypy/pull/19290)) - * Fix missing error when redeclaring type variable in nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) - * support Callable / callable Protocols in suggest decorator unwarpping (Anthony Sottile, PR [19072](https://github.com/python/mypy/pull/19072)) - * Include tuple fallback in constraints built from tuple types (Stanislav Terliakov, PR [19100](https://github.com/python/mypy/pull/19100)) - * Skip existing when retrying upload-pypi.py (Jukka Lehtosalo, PR [19305](https://github.com/python/mypy/pull/19305)) - * Support properties with generic setters (Ivan Levkivskyi, PR [19298](https://github.com/python/mypy/pull/19298)) - * Fix tests in master (Ivan Levkivskyi, PR [19293](https://github.com/python/mypy/pull/19293)) - * Use union of current context and left side for right side narrowing of binary ops (Stanislav Terliakov, PR [19249](https://github.com/python/mypy/pull/19249)) - * Preserve literals when joining Literal and Instance with matching last_known_value (Stanislav Terliakov, PR [19279](https://github.com/python/mypy/pull/19279)) - * Bind self-types in checkmember for decorated classmethods (Stanislav Terliakov, PR [19025](https://github.com/python/mypy/pull/19025)) +### `--allow-redefinition-new` + +Exposes an (experimental) command‑line flag to control whether subclass __new__ redefinitions are accepted. This was previously an internal toggle; it’s now publicly documented via --allow-redefinition-new so advanced projects can fine‑tune behavior without internal flags + +This feature was contributed by Ivan Levkivskyi (PR [19796](https://github.com/python/mypy/pull/19796)). + +### Fixed‑Format Cache (experimental) + +Introduces an optional binary fixed‑format cache that’s both smaller and notably faster to load than the JSON/orjson cache. Local measurements on the PR show ~2.5× faster deserialization than orjson and reviewer benchmarks report a ~35% cached import speedup on a large workload; the flag is currently hidden/opt‑in while we iterate. Follow‑ups further shrink/optimize the format and reduce GC overhead during loads. + +- Initial implementation and flag (hidden): --fixed-format-cache +- Tag packing and compaction: 1‑byte type/symbol tags and u8 storage +- Denser representation for common scalars (int, str) +- Lower GC pressure when reading caches +- Guardrails around constructor cache emission (compatibility) +- Expose --fixed-format-cache if compiled + +This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)) + +### Disjoint Base Classes (@disjoint_base, PEP 800) + +Mypy now implements PEP 800 Disjoint bases: it understands the @disjoint_base marker, rejects class definitions that combine incompatible disjoint bases, and exploits the fact that such classes cannot exist in reachability and narrowing logic + +This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/python/mypy/pull/19678)). + +### Mypy Improvements + +- Improve self check performance by 1.8% (Jukka Lehtosalo, PR [19768](https://github.com/python/mypy/pull/19768), [19769](https://github.com/python/mypy/pull/19769), [19770](https://github.com/python/mypy/pull/19770)) +- Use fast Python wrappers in native_internal (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765)) +- Use macros in native_internal hot paths (Ivan Levkivskyi, PR [19757](https://github.com/python/mypy/pull/19757)) +- Special‑case certain Enum method calls for speed (Ivan Levkivskyi, PR [19634](https://github.com/python/mypy/pull/19634)) +- Two additional micro‑optimizations (Ivan Levkivskyi, PR [19627](https://github.com/python/mypy/pull/19627)) +- Another set of micro‑optimizations (Ivan Levkivskyi, PR [19633](https://github.com/python/mypy/pull/19633)) +- Cache common instances (Ivan Levkivskyi, PR [19621](https://github.com/python/mypy/pull/19621)) +- Skip more method bodies in third‑party libraries for speed (Ivan Levkivskyi, PR [19586](https://github.com/python/mypy/pull/19586)) +- Avoid using a dict in CallableType (Ivan Levkivskyi, PR [19580](https://github.com/python/mypy/pull/19580)) +- Use cache for DictExpr (Ivan Levkivskyi, PR [19536](https://github.com/python/mypy/pull/19536)) +- Use cache for OpExpr (Ivan Levkivskyi, PR [19523](https://github.com/python/mypy/pull/19523)) +- Simple call‑expression cache (Ivan Levkivskyi, PR [19505](https://github.com/python/mypy/pull/19505)) +- Cache type_object_type() (Ivan Levkivskyi, PR [19514](https://github.com/python/mypy/pull/19514)) +- Avoid duplicate visits in boolean‑op checking (Ivan Levkivskyi, PR [19515](https://github.com/python/mypy/pull/19515)) +- Optimize generic inference passes (Ivan Levkivskyi, PR [19501](https://github.com/python/mypy/pull/19501)) +- Speed up default plugin (Jukka Lehtosalo, PR [19462](https://github.com/python/mypy/pull/19462)) +- Micro‑optimize ExpandTypeVisitor (Jukka Lehtosalo, PR [19461](https://github.com/python/mypy/pull/19461)) +- Micro‑optimize type indirection visitor (Jukka Lehtosalo, PR [19460](https://github.com/python/mypy/pull/19460)) +- Micro‑optimize chained plugin (Jukka Lehtosalo, PR [19464](https://github.com/python/mypy/pull/19464)) +- Avoid temporary set creation in is_proper_subtype (Jukka Lehtosalo, PR [19463](https://github.com/python/mypy/pull/19463)) +- Subtype checking micro‑optimization (Jukka Lehtosalo, PR [19384](https://github.com/python/mypy/pull/19384)) +- Speed up default plugin (earlier pass) (Jukka Lehtosalo, PR [19385](https://github.com/python/mypy/pull/19385)) +- Remove nested imports from default plugin (Ivan Levkivskyi, PR [19388](https://github.com/python/mypy/pull/19388)) +- is_subtype: return early where possible (Stanislav Terliakov, PR [19400](https://github.com/python/mypy/pull/19400)) +- Deduplicate fast_container_type / fast_dict_type items before join (Stanislav Terliakov, PR [19409](https://github.com/python/mypy/pull/19409)) +- Speed up type checking by caching argument inference context (Jukka Lehtosalo, PR [19323](https://github.com/python/mypy/pull/19323)) +- Optimize bind_self() and deprecation checks (Ivan Levkivskyi, PR [19556](https://github.com/python/mypy/pull/19556)) +- Keep trivial instances/aliases during expansion (Ivan Levkivskyi, PR [19543](https://github.com/python/mypy/pull/19543)) + +### Stubtest Improvements +- Add temporary --ignore-disjoint-bases flag to ease PEP 800 migration (Joren Hammudoglu, PR [19740](https://github.com/python/mypy/pull/19740)) +- Flag redundant uses of @disjoint_base (Jelle Zijlstra, PR [19715](https://github.com/python/mypy/pull/19715)) +- Improve signatures for __init__ of C classes (Stephen Morton, PR [18259](https://github.com/python/mypy/pull/18259)) +- Handle overloads with mixed pos‑only parameters (Stephen Morton, PR [18287](https://github.com/python/mypy/pull/18287)) +- Use “parameter” (not “argument”) in error messages (PrinceNaroliya, PR [19707](https://github.com/python/mypy/pull/19707)) +- Don’t require @disjoint_base when __slots__ imply finality (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) +- Allow runtime‑existing aliases of @type_check_only types (Brian Schubert, PR [19568](https://github.com/python/mypy/pull/19568)) + +### Bug Fixes + +- Fix crash with variadic tuple arguments to a generic type (Randolf Scholz, [PR #19705](https://github.com/python/mypy/pull/19705)) +- Fix crash when enable_error_code in pyproject.toml has wrong type (wyattscarpenter, [PR #19494](https://github.com/python/mypy/pull/19494)) +- Fix dict assignment to a wider context when an incompatible same‑shape TypedDict exists (Stanislav Terliakov, [PR #19592](https://github.com/python/mypy/pull/19592)) +- Prevent crash for dataclass with PEP 695 TypeVarTuple on Python 3.13+ (Stanislav Terliakov, [PR #19565](https://github.com/python/mypy/pull/19565)) +- Fix constructor type for subclasses of Any (Ivan Levkivskyi, [PR #19295](https://github.com/python/mypy/pull/19295)) +- Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, [PR #19325](https://github.com/python/mypy/pull/19325)) +- Fix TypeIs negative narrowing for unions of generics (Brian Schubert, [PR #18193](https://github.com/python/mypy/pull/18193)) +- dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, [PR #18937](https://github.com/python/mypy/pull/18937)) +- dmypy suggest: fix interaction with __new__ (Stanislav Terliakov, [PR #18966](https://github.com/python/mypy/pull/18966)) +- dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, [PR #19072](https://github.com/python/mypy/pull/19072)) +- Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, [PR #18883](https://github.com/python/mypy/pull/18883)) +- Fix for overloaded type object erasure (Shantanu, [PR #19338](https://github.com/python/mypy/pull/19338)) + +### Mypyc Improvements + +- Fix subclass processing in detect_undefined_bitmap (Chainfire, [PR #19787](https://github.com/python/mypy/pull/19787)) +- Fix C function signature emission (Jukka Lehtosalo, [PR #19773](https://github.com/python/mypy/pull/19773)) +- Use defined __new__ in tp_new and constructor (Piotr Sawicki, [PR #19739](https://github.com/python/mypy/pull/19739)) +- Speed up implicit __ne__ (Jukka Lehtosalo, [PR #19759](https://github.com/python/mypy/pull/19759)) +- Speed up equality with optional str/bytes (Jukka Lehtosalo, [PR #19758](https://github.com/python/mypy/pull/19758)) +- Add __mypyc_empty_tuple__ constant (BobTheBuidler, [PR #19654](https://github.com/python/mypy/pull/19654)) +- Add PyObject_CallObject fast‑path op for fn(*args) (BobTheBuidler, [PR #19631](https://github.com/python/mypy/pull/19631)) +- Add **kwargs star2 fast‑path (follow‑up to starargs) (BobTheBuidler, [PR #19630](https://github.com/python/mypy/pull/19630)) +- Optimize type(x), x.__class__, and .__name__ (Jukka Lehtosalo, [PR #19691](https://github.com/python/mypy/pull/19691), [PR #19683](https://github.com/python/mypy/pull/19683)) +- Specialize bytes.decode for common encodings (Jukka Lehtosalo, [PR #19688](https://github.com/python/mypy/pull/19688)) +- Speed up in against final fixed‑length tuples (Jukka Lehtosalo, [PR #19682](https://github.com/python/mypy/pull/19682)) +- Optimize f‑string building from Final values (BobTheBuidler, [PR #19611](https://github.com/python/mypy/pull/19611)) +- Add exact_dict_set_item_op (BobTheBuidler, [PR #19657](https://github.com/python/mypy/pull/19657)) +- Cache len() when iterating over immutable types (BobTheBuidler, [PR #19656](https://github.com/python/mypy/pull/19656)) +- Add stararg fast‑path for tuple calls fn(*args) (BobTheBuidler, [PR #19623](https://github.com/python/mypy/pull/19623)) +- Include more operations in the mypyc trace log (Jukka Lehtosalo, [PR #19647](https://github.com/python/mypy/pull/19647)) +- Add prefix to attributes of generator classes (Piotr Sawicki, [PR #19535](https://github.com/python/mypy/pull/19535)) +- Fix segfault from heap type objects with static tp_doc (Brian Schubert, [PR #19636](https://github.com/python/mypy/pull/19636)) +- Unwrap NewType to its base type for optimized paths (BobTheBuidler, [PR #19497](https://github.com/python/mypy/pull/19497)) +- Enable free‑threading when compiling multiple modules (Jukka Lehtosalo, [PR #19541](https://github.com/python/mypy/pull/19541)) +- Make type objects immortal under free‑threading (Jukka Lehtosalo, [PR #19538](https://github.com/python/mypy/pull/19538)) +- Fix list.pop primitive on free‑threaded builds (Jukka Lehtosalo, [PR #19522](https://github.com/python/mypy/pull/19522)) +- Generate an export table only for separate compilation (Jukka Lehtosalo, [PR #19521](https://github.com/python/mypy/pull/19521)) +- Add primitives for isinstance of built‑in types (Piotr Sawicki, [PR #19435](https://github.com/python/mypy/pull/19435)) +- Add SetElement op to initialize struct values (Jukka Lehtosalo, [PR #19437](https://github.com/python/mypy/pull/19437)) +- Simplify IR for for loops over strings (Jukka Lehtosalo, [PR #19434](https://github.com/python/mypy/pull/19434)) +- Use native integers for some sequence indexing (Jukka Lehtosalo, [PR #19426](https://github.com/python/mypy/pull/19426)) +- Remove unused CPyList_GetItemUnsafe primitive (Jukka Lehtosalo, [PR #19424](https://github.com/python/mypy/pull/19424)) +- Add native‑int helper methods in IR builder (Jukka Lehtosalo, [PR #19423](https://github.com/python/mypy/pull/19423)) +- Use PyList_Check for isinstance(obj, list) (Piotr Sawicki, [PR #19416](https://github.com/python/mypy/pull/19416)) +- Speed up for loops over native generators (Jukka Lehtosalo, [PR #19415](https://github.com/python/mypy/pull/19415)) +- Report error on reserved method names (Piotr Sawicki, [PR #19407](https://github.com/python/mypy/pull/19407)) +- Add is_bool_or_bit_rprimitive (Piotr Sawicki, [PR #19406](https://github.com/python/mypy/pull/19406)) +- Faster string equality primitive (Jukka Lehtosalo, [PR #19402](https://github.com/python/mypy/pull/19402)) +- Speed up native‑to‑native calls using await (Jukka Lehtosalo, [PR #19398](https://github.com/python/mypy/pull/19398)) +- Raise NameError on undefined names (Piotr Sawicki, [PR #19395](https://github.com/python/mypy/pull/19395)) +- Simplify comparison of tuple elements (Piotr Sawicki, [PR #19396](https://github.com/python/mypy/pull/19396)) +- Use per‑type freelists for nested functions (Jukka Lehtosalo, [PR #19390](https://github.com/python/mypy/pull/19390)) +- Call generator helper directly in await expressions (Jukka Lehtosalo, [PR #19376](https://github.com/python/mypy/pull/19376)) +- Generate introspection signatures for compiled functions (Brian Schubert, [PR #19307](https://github.com/python/mypy/pull/19307)) +- Support C string literals in IR (Jukka Lehtosalo, [PR #19383](https://github.com/python/mypy/pull/19383)) +- Fix error‑value check for GetAttr that allows nullable values (Jukka Lehtosalo, [PR #19378](https://github.com/python/mypy/pull/19378)) +- Fix comparison of tuples with different lengths (Piotr Sawicki, [PR #19372](https://github.com/python/mypy/pull/19372)) +- Speed up generator allocation with per‑type freelists (Jukka Lehtosalo, [PR #19316](https://github.com/python/mypy/pull/19316)) +- Implement list.clear() primitive (Jahongir Qurbonov, [PR #19344](https://github.com/python/mypy/pull/19344)) +- New primitives for weakref.proxy (BobTheBuidler, [PR #19217](https://github.com/python/mypy/pull/19217)) +- New primitive for weakref.ref (BobTheBuidler, [PR #19099](https://github.com/python/mypy/pull/19099)) +- New primitive for str.count (BobTheBuidler, [PR #19264](https://github.com/python/mypy/pull/19264)) +- Tracing/tooling: optionally log sampled operation traces (Jukka Lehtosalo, [PR #19457](https://github.com/python/mypy/pull/19457)) +- Tracing/tooling: script to compile with trace logging and run mypy (Jukka Lehtosalo, [PR #19475](https://github.com/python/mypy/pull/19475)) + + +### Documentation Updates + +- Add idlemypyextension to IDE integrations (CoolCat467, [PR #18615](https://github.com/python/mypy/pull/18615)) +- Update stubinfo for latest typeshed (Shantanu, [PR #19771](https://github.com/python/mypy/pull/19771)) +- Document that object is often preferable to Any in APIs (wyattscarpenter, [PR #19103](https://github.com/python/mypy/pull/19103)) +- Include a detailed listing of flags enabled by --strict (wyattscarpenter, [PR #19062](https://github.com/python/mypy/pull/19062)) +- Update “common issues” (reveal_type/reveal_locals; note on orjson) (wyattscarpenter, [PR #19059](https://github.com/python/mypy/pull/19059), [PR #19058](https://github.com/python/mypy/pull/19058)) + +### Other Notable Improvements + +- Remove deprecated --new-type-inference flag (the new algorithm has long been default) (Ivan Levkivskyi, [PR #19570](https://github.com/python/mypy/pull/19570)) +- Use empty context as a fallback for return expressions when outer context misleads inference (Ivan Levkivskyi, [PR #19767](https://github.com/python/mypy/pull/19767)) +- Support --strict-equality checks involving None (Christoph Tyralla, [PR #19718](https://github.com/python/mypy/pull/19718)) +- Don’t show import‑related errors after a module‑level assert False (Stanislav Terliakov, [PR #19347](https://github.com/python/mypy/pull/19347)) +- Fix forward refs in type parameters of over‑parameterized PEP 695 aliases (Brian Schubert, [PR #19725](https://github.com/python/mypy/pull/19725)) +- Don’t expand PEP 695 aliases when checking node fullnames (Brian Schubert, [PR #19699](https://github.com/python/mypy/pull/19699)) +- Don’t use outer context for or expression inference when LHS is Any (Stanislav Terliakov, [PR #19748](https://github.com/python/mypy/pull/19748)) +- Interpret bare ClassVar as inferred (not Any) (Ivan Levkivskyi, [PR #19573](https://github.com/python/mypy/pull/19573)) +- Recognize buffer protocol special methods (Brian Schubert, [PR #19581](https://github.com/python/mypy/pull/19581)) +- Add temporary named expressions for match subjects (Stanislav Terliakov, [PR #18446](https://github.com/python/mypy/pull/18446)) +- Support attribute access on enum members correctly (Stanislav Terliakov, [PR #19422](https://github.com/python/mypy/pull/19422)) +- Check __slots__ assignments on self types (Stanislav Terliakov, [PR #19332](https://github.com/python/mypy/pull/19332)) +- Move self‑argument checks after decorator application (Stanislav Terliakov, [PR #19490](https://github.com/python/mypy/pull/19490)) +- Infer empty list for __slots__ and module __all__ (Stanislav Terliakov, [PR #19348](https://github.com/python/mypy/pull/19348)) +- Use normalized tuples for fallback calculation (Stanislav Terliakov, [PR #19111](https://github.com/python/mypy/pull/19111)) +- Preserve literals when joining Literal with Instance that has matching last_known_value (Stanislav Terliakov, [PR #19279](https://github.com/python/mypy/pull/19279)) +- Allow adjacent conditionally‑defined overloads (Stanislav Terliakov, [PR #19042](https://github.com/python/mypy/pull/19042)) +- Check property decorators more strictly (Stanislav Terliakov, [PR #19313](https://github.com/python/mypy/pull/19313)) +- Support properties with generic setters (Ivan Levkivskyi, [PR #19298](https://github.com/python/mypy/pull/19298)) +- Generalize class/static method and property alias support (Ivan Levkivskyi, [PR #19297](https://github.com/python/mypy/pull/19297)) +- Re‑widen custom properties after narrowing (Ivan Levkivskyi, [PR #19296](https://github.com/python/mypy/pull/19296)) +- Avoid erasing type objects when checking runtime cover (Shantanu, [PR #19320](https://github.com/python/mypy/pull/19320)) +- Include tuple fallback in constraints built from tuple types (Stanislav Terliakov, [PR #19100](https://github.com/python/mypy/pull/19100)) +- Somewhat better isinstance support on old‑style unions (Shantanu, [PR #19714](https://github.com/python/mypy/pull/19714)) +- Improve promotions inside unions (Christoph Tyralla, [PR #19245](https://github.com/python/mypy/pull/19245)) +- Uninhabited types should have all attributes (Ivan Levkivskyi, [PR #19300](https://github.com/python/mypy/pull/19300)) +- Metaclass conflict checks improved (Robsdedude, [PR #17682](https://github.com/python/mypy/pull/17682)) +- Metaclass resolution algorithm fixes (Robsdedude, [PR #17713](https://github.com/python/mypy/pull/17713)) +- PEP 702 @deprecated: handle “combined” overloads (Christoph Tyralla, [PR #19626](https://github.com/python/mypy/pull/19626)) +- PEP 702 @deprecated: include overloads in snapshot descriptions (Christoph Tyralla, [PR #19613](https://github.com/python/mypy/pull/19613)) +- Ignore overload implementation when checking __OP__ / __rOP__ compatibility (Stanislav Terliakov, [PR #18502](https://github.com/python/mypy/pull/18502)) +- Fix unwrapping of assignment expressions in match subject (Marc Mueller, [PR #19742](https://github.com/python/mypy/pull/19742)) +- Omit errors for class patterns against object (Marc Mueller, [PR #19709](https://github.com/python/mypy/pull/19709)) +- Remove unnecessary error for certain match class patterns (Marc Mueller, [PR #19708](https://github.com/python/mypy/pull/19708)) +- Use union type for captured vars in or pattern (Marc Mueller, [PR #19710](https://github.com/python/mypy/pull/19710)) +- Prevent final reassignment inside match case (Omer Hadari, [PR #19496](https://github.com/python/mypy/pull/19496)) +- Support _value_ as a fallback for ellipsis Enum members (Stanislav Terliakov, [PR #19352](https://github.com/python/mypy/pull/19352)) +- Sort arguments in TypedDict overlap messages (Marc Mueller, [PR #19666](https://github.com/python/mypy/pull/19666)) +- Reset to previous statement on leaving return in semanal (Stanislav Terliakov, [PR #19642](https://github.com/python/mypy/pull/19642)) +- Add ambiguous to UninhabitedType identity for better messaging (Stanislav Terliakov, [PR #19648](https://github.com/python/mypy/pull/19648)) +- Further fix overload diagnostics for varargs/kwargs (Shantanu, [PR #19619](https://github.com/python/mypy/pull/19619)) +- Fix overload diagnostics when vararg and varkwarg both match (Shantanu, [PR #19614](https://github.com/python/mypy/pull/19614)) +- Show type variable name in “Cannot infer type argument” (Brian Schubert, [PR #19290](https://github.com/python/mypy/pull/19290)) +- Fail gracefully on unsupported template strings (PEP 750) (Brian Schubert, [PR #19700](https://github.com/python/mypy/pull/19700)) +- Revert colored argparse help for Python 3.14 (Marc Mueller, [PR #19721](https://github.com/python/mypy/pull/19721)) +- Support type‑checking a code fragment in the profile script (Jukka Lehtosalo, [PR #19379](https://github.com/python/mypy/pull/19379)) +- Fix C compiler flags in the profile self‑check script (Jukka Lehtosalo, [PR #19326](https://github.com/python/mypy/pull/19326)) +- Add a script for profiling self‑check (Linux only) (Jukka Lehtosalo, [PR #19322](https://github.com/python/mypy/pull/19322)) +- Retry PyPI upload script: skip existing files on retry (Jukka Lehtosalo, [PR #19305](https://github.com/python/mypy/pull/19305)) + +### Typeshed Updates + +Please see [git log](https://github.com/python/typeshed/commits/main?after=2480d7e7c74493a024eaf254c5d2c6f452c80ee2+0&branch=main&path=stdlib) for full list of standard library typeshed stub changes. ### Acknowledgements From 1372e5889c5650f97c8ea152144e2fc90dede23b Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 03:53:18 -0400 Subject: [PATCH 03/10] added backticks --- CHANGELOG.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cb9b77fa31..d748bc1d9131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ You can read the full documentation for this release on [Read the Docs](http://m ### `--allow-redefinition-new` -Exposes an (experimental) command‑line flag to control whether subclass __new__ redefinitions are accepted. This was previously an internal toggle; it’s now publicly documented via --allow-redefinition-new so advanced projects can fine‑tune behavior without internal flags +Exposes an (experimental) command‑line flag to control whether subclass `__new__` redefinitions are accepted. This was previously an internal toggle; it’s now publicly documented via --allow-redefinition-new so advanced projects can fine‑tune behavior without internal flags This feature was contributed by Ivan Levkivskyi (PR [19796](https://github.com/python/mypy/pull/19796)). @@ -71,10 +71,10 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py ### Stubtest Improvements - Add temporary --ignore-disjoint-bases flag to ease PEP 800 migration (Joren Hammudoglu, PR [19740](https://github.com/python/mypy/pull/19740)) - Flag redundant uses of @disjoint_base (Jelle Zijlstra, PR [19715](https://github.com/python/mypy/pull/19715)) -- Improve signatures for __init__ of C classes (Stephen Morton, PR [18259](https://github.com/python/mypy/pull/18259)) +- Improve signatures for `__init__` of C classes (Stephen Morton, PR [18259](https://github.com/python/mypy/pull/18259)) - Handle overloads with mixed pos‑only parameters (Stephen Morton, PR [18287](https://github.com/python/mypy/pull/18287)) - Use “parameter” (not “argument”) in error messages (PrinceNaroliya, PR [19707](https://github.com/python/mypy/pull/19707)) -- Don’t require @disjoint_base when __slots__ imply finality (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) +- Don’t require @disjoint_base when `__slots__` imply finality (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) - Allow runtime‑existing aliases of @type_check_only types (Brian Schubert, PR [19568](https://github.com/python/mypy/pull/19568)) ### Bug Fixes @@ -87,7 +87,7 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, [PR #19325](https://github.com/python/mypy/pull/19325)) - Fix TypeIs negative narrowing for unions of generics (Brian Schubert, [PR #18193](https://github.com/python/mypy/pull/18193)) - dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, [PR #18937](https://github.com/python/mypy/pull/18937)) -- dmypy suggest: fix interaction with __new__ (Stanislav Terliakov, [PR #18966](https://github.com/python/mypy/pull/18966)) +- dmypy suggest: fix interaction with `__new__` (Stanislav Terliakov, [PR #18966](https://github.com/python/mypy/pull/18966)) - dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, [PR #19072](https://github.com/python/mypy/pull/19072)) - Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, [PR #18883](https://github.com/python/mypy/pull/18883)) - Fix for overloaded type object erasure (Shantanu, [PR #19338](https://github.com/python/mypy/pull/19338)) @@ -96,13 +96,13 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Fix subclass processing in detect_undefined_bitmap (Chainfire, [PR #19787](https://github.com/python/mypy/pull/19787)) - Fix C function signature emission (Jukka Lehtosalo, [PR #19773](https://github.com/python/mypy/pull/19773)) -- Use defined __new__ in tp_new and constructor (Piotr Sawicki, [PR #19739](https://github.com/python/mypy/pull/19739)) -- Speed up implicit __ne__ (Jukka Lehtosalo, [PR #19759](https://github.com/python/mypy/pull/19759)) +- Use defined `__new__` in tp_new and constructor (Piotr Sawicki, [PR #19739](https://github.com/python/mypy/pull/19739)) +- Speed up implicit `__ne__` (Jukka Lehtosalo, [PR #19759](https://github.com/python/mypy/pull/19759)) - Speed up equality with optional str/bytes (Jukka Lehtosalo, [PR #19758](https://github.com/python/mypy/pull/19758)) -- Add __mypyc_empty_tuple__ constant (BobTheBuidler, [PR #19654](https://github.com/python/mypy/pull/19654)) +- Add `__mypyc_empty_tuple__` constant (BobTheBuidler, [PR #19654](https://github.com/python/mypy/pull/19654)) - Add PyObject_CallObject fast‑path op for fn(*args) (BobTheBuidler, [PR #19631](https://github.com/python/mypy/pull/19631)) - Add **kwargs star2 fast‑path (follow‑up to starargs) (BobTheBuidler, [PR #19630](https://github.com/python/mypy/pull/19630)) -- Optimize type(x), x.__class__, and .__name__ (Jukka Lehtosalo, [PR #19691](https://github.com/python/mypy/pull/19691), [PR #19683](https://github.com/python/mypy/pull/19683)) +- Optimize type(x), x.`__class__`, and `.__name__` (Jukka Lehtosalo, [PR #19691](https://github.com/python/mypy/pull/19691), [PR #19683](https://github.com/python/mypy/pull/19683)) - Specialize bytes.decode for common encodings (Jukka Lehtosalo, [PR #19688](https://github.com/python/mypy/pull/19688)) - Speed up in against final fixed‑length tuples (Jukka Lehtosalo, [PR #19682](https://github.com/python/mypy/pull/19682)) - Optimize f‑string building from Final values (BobTheBuidler, [PR #19611](https://github.com/python/mypy/pull/19611)) @@ -167,9 +167,9 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Recognize buffer protocol special methods (Brian Schubert, [PR #19581](https://github.com/python/mypy/pull/19581)) - Add temporary named expressions for match subjects (Stanislav Terliakov, [PR #18446](https://github.com/python/mypy/pull/18446)) - Support attribute access on enum members correctly (Stanislav Terliakov, [PR #19422](https://github.com/python/mypy/pull/19422)) -- Check __slots__ assignments on self types (Stanislav Terliakov, [PR #19332](https://github.com/python/mypy/pull/19332)) +- Check `__slots__` assignments on self types (Stanislav Terliakov, [PR #19332](https://github.com/python/mypy/pull/19332)) - Move self‑argument checks after decorator application (Stanislav Terliakov, [PR #19490](https://github.com/python/mypy/pull/19490)) -- Infer empty list for __slots__ and module __all__ (Stanislav Terliakov, [PR #19348](https://github.com/python/mypy/pull/19348)) +- Infer empty list for `__slots__` and module `__all__` (Stanislav Terliakov, [PR #19348](https://github.com/python/mypy/pull/19348)) - Use normalized tuples for fallback calculation (Stanislav Terliakov, [PR #19111](https://github.com/python/mypy/pull/19111)) - Preserve literals when joining Literal with Instance that has matching last_known_value (Stanislav Terliakov, [PR #19279](https://github.com/python/mypy/pull/19279)) - Allow adjacent conditionally‑defined overloads (Stanislav Terliakov, [PR #19042](https://github.com/python/mypy/pull/19042)) @@ -186,7 +186,7 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Metaclass resolution algorithm fixes (Robsdedude, [PR #17713](https://github.com/python/mypy/pull/17713)) - PEP 702 @deprecated: handle “combined” overloads (Christoph Tyralla, [PR #19626](https://github.com/python/mypy/pull/19626)) - PEP 702 @deprecated: include overloads in snapshot descriptions (Christoph Tyralla, [PR #19613](https://github.com/python/mypy/pull/19613)) -- Ignore overload implementation when checking __OP__ / __rOP__ compatibility (Stanislav Terliakov, [PR #18502](https://github.com/python/mypy/pull/18502)) +- Ignore overload implementation when checking `__OP__` / `__rOP__` compatibility (Stanislav Terliakov, [PR #18502](https://github.com/python/mypy/pull/18502)) - Fix unwrapping of assignment expressions in match subject (Marc Mueller, [PR #19742](https://github.com/python/mypy/pull/19742)) - Omit errors for class patterns against object (Marc Mueller, [PR #19709](https://github.com/python/mypy/pull/19709)) - Remove unnecessary error for certain match class patterns (Marc Mueller, [PR #19708](https://github.com/python/mypy/pull/19708)) From e4e3f2419fefa62bdcea1d6c16933cb96aa1a625 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 07:57:43 +0000 Subject: [PATCH 04/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d748bc1d9131..e740dd058565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/p ### Disjoint Base Classes (@disjoint_base, PEP 800) -Mypy now implements PEP 800 Disjoint bases: it understands the @disjoint_base marker, rejects class definitions that combine incompatible disjoint bases, and exploits the fact that such classes cannot exist in reachability and narrowing logic +Mypy now implements PEP 800 Disjoint bases: it understands the @disjoint_base marker, rejects class definitions that combine incompatible disjoint bases, and exploits the fact that such classes cannot exist in reachability and narrowing logic This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/python/mypy/pull/19678)). From 70ca5ed0dbb4794f7f65a187bf31854f92cfe81f Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 04:12:18 -0400 Subject: [PATCH 05/10] update hyperlinks --- CHANGELOG.md | 238 ++++++++++++++++++++++++++------------------------- 1 file changed, 121 insertions(+), 117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d748bc1d9131..0895405f319b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## Mypy 1.18 (Unreleased) -We’ve just uploaded mypy 1.16 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). +We’ve just uploaded mypy 1.18 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)). Mypy is a static type checker for Python. This release includes new features and bug fixes. You can install it as follows: @@ -76,135 +76,139 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Use “parameter” (not “argument”) in error messages (PrinceNaroliya, PR [19707](https://github.com/python/mypy/pull/19707)) - Don’t require @disjoint_base when `__slots__` imply finality (Jelle Zijlstra, PR [19701](https://github.com/python/mypy/pull/19701)) - Allow runtime‑existing aliases of @type_check_only types (Brian Schubert, PR [19568](https://github.com/python/mypy/pull/19568)) +- More detailed checking of type objects in stubtest (Stephen Morton, PR [18251](https://github.com/python/mypy/pull/18251)) +- Support running stubtest in non-UTF8 terminals (Stanislav Terliakovm, PR [19085](https://github.com/python/mypy/pull/19085)) ### Bug Fixes -- Fix crash with variadic tuple arguments to a generic type (Randolf Scholz, [PR #19705](https://github.com/python/mypy/pull/19705)) -- Fix crash when enable_error_code in pyproject.toml has wrong type (wyattscarpenter, [PR #19494](https://github.com/python/mypy/pull/19494)) -- Fix dict assignment to a wider context when an incompatible same‑shape TypedDict exists (Stanislav Terliakov, [PR #19592](https://github.com/python/mypy/pull/19592)) -- Prevent crash for dataclass with PEP 695 TypeVarTuple on Python 3.13+ (Stanislav Terliakov, [PR #19565](https://github.com/python/mypy/pull/19565)) -- Fix constructor type for subclasses of Any (Ivan Levkivskyi, [PR #19295](https://github.com/python/mypy/pull/19295)) -- Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, [PR #19325](https://github.com/python/mypy/pull/19325)) -- Fix TypeIs negative narrowing for unions of generics (Brian Schubert, [PR #18193](https://github.com/python/mypy/pull/18193)) -- dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, [PR #18937](https://github.com/python/mypy/pull/18937)) -- dmypy suggest: fix interaction with `__new__` (Stanislav Terliakov, [PR #18966](https://github.com/python/mypy/pull/18966)) -- dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, [PR #19072](https://github.com/python/mypy/pull/19072)) -- Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, [PR #18883](https://github.com/python/mypy/pull/18883)) -- Fix for overloaded type object erasure (Shantanu, [PR #19338](https://github.com/python/mypy/pull/19338)) +- Fix crash with variadic tuple arguments to a generic type (Randolf Scholz, PR [19705](https://github.com/python/mypy/pull/19705)) +- Fix crash when enable_error_code in pyproject.toml has wrong type (wyattscarpenter, PR [19494](https://github.com/python/mypy/pull/19494)) +- Fix dict assignment to a wider context when an incompatible same‑shape TypedDict exists (Stanislav Terliakov, PR [19592](https://github.com/python/mypy/pull/19592)) +- Prevent crash for dataclass with PEP 695 TypeVarTuple on Python 3.13+ (Stanislav Terliakov, PR [19565](https://github.com/python/mypy/pull/19565)) +- Fix constructor type for subclasses of Any (Ivan Levkivskyi, PR [19295](https://github.com/python/mypy/pull/19295)) +- Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, PR [19325](https://github.com/python/mypy/pull/19325)) +- Fix TypeIs negative narrowing for unions of generics (Brian Schubert, PR [18193](https://github.com/python/mypy/pull/18193)) +- dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, PR [18937](https://github.com/python/mypy/pull/18937)) +- dmypy suggest: fix interaction with `__new__` (Stanislav Terliakov, PR [18966](https://github.com/python/mypy/pull/18966)) +- dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, PR [19072](https://github.com/python/mypy/pull/19072)) +- Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) +- Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) +- Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) +- Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19577)) ### Mypyc Improvements -- Fix subclass processing in detect_undefined_bitmap (Chainfire, [PR #19787](https://github.com/python/mypy/pull/19787)) -- Fix C function signature emission (Jukka Lehtosalo, [PR #19773](https://github.com/python/mypy/pull/19773)) -- Use defined `__new__` in tp_new and constructor (Piotr Sawicki, [PR #19739](https://github.com/python/mypy/pull/19739)) -- Speed up implicit `__ne__` (Jukka Lehtosalo, [PR #19759](https://github.com/python/mypy/pull/19759)) -- Speed up equality with optional str/bytes (Jukka Lehtosalo, [PR #19758](https://github.com/python/mypy/pull/19758)) -- Add `__mypyc_empty_tuple__` constant (BobTheBuidler, [PR #19654](https://github.com/python/mypy/pull/19654)) -- Add PyObject_CallObject fast‑path op for fn(*args) (BobTheBuidler, [PR #19631](https://github.com/python/mypy/pull/19631)) -- Add **kwargs star2 fast‑path (follow‑up to starargs) (BobTheBuidler, [PR #19630](https://github.com/python/mypy/pull/19630)) -- Optimize type(x), x.`__class__`, and `.__name__` (Jukka Lehtosalo, [PR #19691](https://github.com/python/mypy/pull/19691), [PR #19683](https://github.com/python/mypy/pull/19683)) -- Specialize bytes.decode for common encodings (Jukka Lehtosalo, [PR #19688](https://github.com/python/mypy/pull/19688)) -- Speed up in against final fixed‑length tuples (Jukka Lehtosalo, [PR #19682](https://github.com/python/mypy/pull/19682)) -- Optimize f‑string building from Final values (BobTheBuidler, [PR #19611](https://github.com/python/mypy/pull/19611)) -- Add exact_dict_set_item_op (BobTheBuidler, [PR #19657](https://github.com/python/mypy/pull/19657)) -- Cache len() when iterating over immutable types (BobTheBuidler, [PR #19656](https://github.com/python/mypy/pull/19656)) -- Add stararg fast‑path for tuple calls fn(*args) (BobTheBuidler, [PR #19623](https://github.com/python/mypy/pull/19623)) -- Include more operations in the mypyc trace log (Jukka Lehtosalo, [PR #19647](https://github.com/python/mypy/pull/19647)) -- Add prefix to attributes of generator classes (Piotr Sawicki, [PR #19535](https://github.com/python/mypy/pull/19535)) -- Fix segfault from heap type objects with static tp_doc (Brian Schubert, [PR #19636](https://github.com/python/mypy/pull/19636)) -- Unwrap NewType to its base type for optimized paths (BobTheBuidler, [PR #19497](https://github.com/python/mypy/pull/19497)) -- Enable free‑threading when compiling multiple modules (Jukka Lehtosalo, [PR #19541](https://github.com/python/mypy/pull/19541)) -- Make type objects immortal under free‑threading (Jukka Lehtosalo, [PR #19538](https://github.com/python/mypy/pull/19538)) -- Fix list.pop primitive on free‑threaded builds (Jukka Lehtosalo, [PR #19522](https://github.com/python/mypy/pull/19522)) -- Generate an export table only for separate compilation (Jukka Lehtosalo, [PR #19521](https://github.com/python/mypy/pull/19521)) -- Add primitives for isinstance of built‑in types (Piotr Sawicki, [PR #19435](https://github.com/python/mypy/pull/19435)) -- Add SetElement op to initialize struct values (Jukka Lehtosalo, [PR #19437](https://github.com/python/mypy/pull/19437)) -- Simplify IR for for loops over strings (Jukka Lehtosalo, [PR #19434](https://github.com/python/mypy/pull/19434)) -- Use native integers for some sequence indexing (Jukka Lehtosalo, [PR #19426](https://github.com/python/mypy/pull/19426)) -- Remove unused CPyList_GetItemUnsafe primitive (Jukka Lehtosalo, [PR #19424](https://github.com/python/mypy/pull/19424)) -- Add native‑int helper methods in IR builder (Jukka Lehtosalo, [PR #19423](https://github.com/python/mypy/pull/19423)) -- Use PyList_Check for isinstance(obj, list) (Piotr Sawicki, [PR #19416](https://github.com/python/mypy/pull/19416)) -- Speed up for loops over native generators (Jukka Lehtosalo, [PR #19415](https://github.com/python/mypy/pull/19415)) -- Report error on reserved method names (Piotr Sawicki, [PR #19407](https://github.com/python/mypy/pull/19407)) -- Add is_bool_or_bit_rprimitive (Piotr Sawicki, [PR #19406](https://github.com/python/mypy/pull/19406)) -- Faster string equality primitive (Jukka Lehtosalo, [PR #19402](https://github.com/python/mypy/pull/19402)) -- Speed up native‑to‑native calls using await (Jukka Lehtosalo, [PR #19398](https://github.com/python/mypy/pull/19398)) -- Raise NameError on undefined names (Piotr Sawicki, [PR #19395](https://github.com/python/mypy/pull/19395)) -- Simplify comparison of tuple elements (Piotr Sawicki, [PR #19396](https://github.com/python/mypy/pull/19396)) -- Use per‑type freelists for nested functions (Jukka Lehtosalo, [PR #19390](https://github.com/python/mypy/pull/19390)) -- Call generator helper directly in await expressions (Jukka Lehtosalo, [PR #19376](https://github.com/python/mypy/pull/19376)) -- Generate introspection signatures for compiled functions (Brian Schubert, [PR #19307](https://github.com/python/mypy/pull/19307)) -- Support C string literals in IR (Jukka Lehtosalo, [PR #19383](https://github.com/python/mypy/pull/19383)) -- Fix error‑value check for GetAttr that allows nullable values (Jukka Lehtosalo, [PR #19378](https://github.com/python/mypy/pull/19378)) -- Fix comparison of tuples with different lengths (Piotr Sawicki, [PR #19372](https://github.com/python/mypy/pull/19372)) -- Speed up generator allocation with per‑type freelists (Jukka Lehtosalo, [PR #19316](https://github.com/python/mypy/pull/19316)) -- Implement list.clear() primitive (Jahongir Qurbonov, [PR #19344](https://github.com/python/mypy/pull/19344)) -- New primitives for weakref.proxy (BobTheBuidler, [PR #19217](https://github.com/python/mypy/pull/19217)) -- New primitive for weakref.ref (BobTheBuidler, [PR #19099](https://github.com/python/mypy/pull/19099)) -- New primitive for str.count (BobTheBuidler, [PR #19264](https://github.com/python/mypy/pull/19264)) -- Tracing/tooling: optionally log sampled operation traces (Jukka Lehtosalo, [PR #19457](https://github.com/python/mypy/pull/19457)) -- Tracing/tooling: script to compile with trace logging and run mypy (Jukka Lehtosalo, [PR #19475](https://github.com/python/mypy/pull/19475)) +- Fix subclass processing in detect_undefined_bitmap (Chainfire, PR [19787](https://github.com/python/mypy/pull/19787)) +- Fix C function signature emission (Jukka Lehtosalo, PR [19773](https://github.com/python/mypy/pull/19773)) +- Use defined `__new__` in tp_new and constructor (Piotr Sawicki, PR [19739](https://github.com/python/mypy/pull/19739)) +- Speed up implicit `__ne__` (Jukka Lehtosalo, PR [19759](https://github.com/python/mypy/pull/19759)) +- Speed up equality with optional str/bytes (Jukka Lehtosalo, PR [19758](https://github.com/python/mypy/pull/19758)) +- Add `__mypyc_empty_tuple__` constant (BobTheBuidler, PR [19654](https://github.com/python/mypy/pull/19654)) +- Add PyObject_CallObject fast‑path op for fn(*args) (BobTheBuidler, PR [19631](https://github.com/python/mypy/pull/19631)) +- Add **kwargs star2 fast‑path (follow‑up to starargs) (BobTheBuidler, PR [19630](https://github.com/python/mypy/pull/19630)) +- Optimize type(x), x.`__class__`, and `.__name__` (Jukka Lehtosalo, PR [19691](https://github.com/python/mypy/pull/19691), [19683](https://github.com/python/mypy/pull/19683)) +- Specialize bytes.decode for common encodings (Jukka Lehtosalo, PR [19688](https://github.com/python/mypy/pull/19688)) +- Speed up in against final fixed‑length tuples (Jukka Lehtosalo, PR [19682](https://github.com/python/mypy/pull/19682)) +- Optimize f‑string building from Final values (BobTheBuidler, PR [19611](https://github.com/python/mypy/pull/19611)) +- Add exact_dict_set_item_op (BobTheBuidler, PR [19657](https://github.com/python/mypy/pull/19657)) +- Cache len() when iterating over immutable types (BobTheBuidler, PR [19656](https://github.com/python/mypy/pull/19656)) +- Add stararg fast‑path for tuple calls fn(*args) (BobTheBuidler, PR [19623](https://github.com/python/mypy/pull/19623)) +- Include more operations in the mypyc trace log (Jukka Lehtosalo, PR [19647](https://github.com/python/mypy/pull/19647)) +- Add prefix to attributes of generator classes (Piotr Sawicki, PR [19535](https://github.com/python/mypy/pull/19535)) +- Fix segfault from heap type objects with static tp_doc (Brian Schubert, PR [19636](https://github.com/python/mypy/pull/19636)) +- Unwrap NewType to its base type for optimized paths (BobTheBuidler, PR [19497](https://github.com/python/mypy/pull/19497)) +- Enable free‑threading when compiling multiple modules (Jukka Lehtosalo, PR [19541](https://github.com/python/mypy/pull/19541)) +- Make type objects immortal under free‑threading (Jukka Lehtosalo, PR [19538](https://github.com/python/mypy/pull/19538)) +- Fix list.pop primitive on free‑threaded builds (Jukka Lehtosalo, PR [19522](https://github.com/python/mypy/pull/19522)) +- Generate an export table only for separate compilation (Jukka Lehtosalo, PR [19521](https://github.com/python/mypy/pull/19521)) +- Add primitives for isinstance of built‑in types (Piotr Sawicki, PR [19435](https://github.com/python/mypy/pull/19435)) +- Add SetElement op to initialize struct values (Jukka Lehtosalo, PR [19437](https://github.com/python/mypy/pull/19437)) +- Simplify IR for for loops over strings (Jukka Lehtosalo, PR [19434](https://github.com/python/mypy/pull/19434)) +- Use native integers for some sequence indexing (Jukka Lehtosalo, PR [19426](https://github.com/python/mypy/pull/19426)) +- Remove unused CPyList_GetItemUnsafe primitive (Jukka Lehtosalo, PR [19424](https://github.com/python/mypy/pull/19424)) +- Add native‑int helper methods in IR builder (Jukka Lehtosalo, PR [19423](https://github.com/python/mypy/pull/19423)) +- Use PyList_Check for isinstance(obj, list) (Piotr Sawicki, PR [19416](https://github.com/python/mypy/pull/19416)) +- Speed up for loops over native generators (Jukka Lehtosalo, PR [19415](https://github.com/python/mypy/pull/19415)) +- Report error on reserved method names (Piotr Sawicki, PR [19407](https://github.com/python/mypy/pull/19407)) +- Add is_bool_or_bit_rprimitive (Piotr Sawicki, PR [19406](https://github.com/python/mypy/pull/19406)) +- Faster string equality primitive (Jukka Lehtosalo, PR [19402](https://github.com/python/mypy/pull/19402)) +- Speed up native‑to‑native calls using await (Jukka Lehtosalo, PR [19398](https://github.com/python/mypy/pull/19398)) +- Raise NameError on undefined names (Piotr Sawicki, PR [19395](https://github.com/python/mypy/pull/19395)) +- Simplify comparison of tuple elements (Piotr Sawicki, PR [19396](https://github.com/python/mypy/pull/19396)) +- Use per‑type freelists for nested functions (Jukka Lehtosalo, PR [19390](https://github.com/python/mypy/pull/19390)) +- Call generator helper directly in await expressions (Jukka Lehtosalo, PR [19376](https://github.com/python/mypy/pull/19376)) +- Generate introspection signatures for compiled functions (Brian Schubert, PR [19307](https://github.com/python/mypy/pull/19307)) +- Support C string literals in IR (Jukka Lehtosalo, PR [19383](https://github.com/python/mypy/pull/19383)) +- Fix error‑value check for GetAttr that allows nullable values (Jukka Lehtosalo, PR [19378](https://github.com/python/mypy/pull/19378)) +- Fix comparison of tuples with different lengths (Piotr Sawicki, PR [19372](https://github.com/python/mypy/pull/19372)) +- Speed up generator allocation with per‑type freelists (Jukka Lehtosalo, PR [19316](https://github.com/python/mypy/pull/19316)) +- Implement list.clear() primitive (Jahongir Qurbonov, PR [19344](https://github.com/python/mypy/pull/19344)) +- New primitives for weakref.proxy (BobTheBuidler, PR [19217](https://github.com/python/mypy/pull/19217)) +- New primitive for weakref.ref (BobTheBuidler, PR [19099](https://github.com/python/mypy/pull/19099)) +- New primitive for str.count (BobTheBuidler, PR [19264](https://github.com/python/mypy/pull/19264)) +- Tracing/tooling: optionally log sampled operation traces (Jukka Lehtosalo, PR [19457](https://github.com/python/mypy/pull/19457)) +- Tracing/tooling: script to compile with trace logging and run mypy (Jukka Lehtosalo, PR [19475](https://github.com/python/mypy/pull/19475)) ### Documentation Updates -- Add idlemypyextension to IDE integrations (CoolCat467, [PR #18615](https://github.com/python/mypy/pull/18615)) -- Update stubinfo for latest typeshed (Shantanu, [PR #19771](https://github.com/python/mypy/pull/19771)) -- Document that object is often preferable to Any in APIs (wyattscarpenter, [PR #19103](https://github.com/python/mypy/pull/19103)) -- Include a detailed listing of flags enabled by --strict (wyattscarpenter, [PR #19062](https://github.com/python/mypy/pull/19062)) -- Update “common issues” (reveal_type/reveal_locals; note on orjson) (wyattscarpenter, [PR #19059](https://github.com/python/mypy/pull/19059), [PR #19058](https://github.com/python/mypy/pull/19058)) +- Add idlemypyextension to IDE integrations (CoolCat467, PR [18615](https://github.com/python/mypy/pull/18615)) +- Update stubinfo for latest typeshed (Shantanu, PR [19771](https://github.com/python/mypy/pull/19771)) +- Document that object is often preferable to Any in APIs (wyattscarpenter, PR [19103](https://github.com/python/mypy/pull/19103)) +- Include a detailed listing of flags enabled by --strict (wyattscarpenter, PR [19062](https://github.com/python/mypy/pull/19062)) +- Update “common issues” (reveal_type/reveal_locals; note on orjson) (wyattscarpenter, PR [19059](https://github.com/python/mypy/pull/19059), [19058](https://github.com/python/mypy/pull/19058)) ### Other Notable Improvements -- Remove deprecated --new-type-inference flag (the new algorithm has long been default) (Ivan Levkivskyi, [PR #19570](https://github.com/python/mypy/pull/19570)) -- Use empty context as a fallback for return expressions when outer context misleads inference (Ivan Levkivskyi, [PR #19767](https://github.com/python/mypy/pull/19767)) -- Support --strict-equality checks involving None (Christoph Tyralla, [PR #19718](https://github.com/python/mypy/pull/19718)) -- Don’t show import‑related errors after a module‑level assert False (Stanislav Terliakov, [PR #19347](https://github.com/python/mypy/pull/19347)) -- Fix forward refs in type parameters of over‑parameterized PEP 695 aliases (Brian Schubert, [PR #19725](https://github.com/python/mypy/pull/19725)) -- Don’t expand PEP 695 aliases when checking node fullnames (Brian Schubert, [PR #19699](https://github.com/python/mypy/pull/19699)) -- Don’t use outer context for or expression inference when LHS is Any (Stanislav Terliakov, [PR #19748](https://github.com/python/mypy/pull/19748)) -- Interpret bare ClassVar as inferred (not Any) (Ivan Levkivskyi, [PR #19573](https://github.com/python/mypy/pull/19573)) -- Recognize buffer protocol special methods (Brian Schubert, [PR #19581](https://github.com/python/mypy/pull/19581)) -- Add temporary named expressions for match subjects (Stanislav Terliakov, [PR #18446](https://github.com/python/mypy/pull/18446)) -- Support attribute access on enum members correctly (Stanislav Terliakov, [PR #19422](https://github.com/python/mypy/pull/19422)) -- Check `__slots__` assignments on self types (Stanislav Terliakov, [PR #19332](https://github.com/python/mypy/pull/19332)) -- Move self‑argument checks after decorator application (Stanislav Terliakov, [PR #19490](https://github.com/python/mypy/pull/19490)) -- Infer empty list for `__slots__` and module `__all__` (Stanislav Terliakov, [PR #19348](https://github.com/python/mypy/pull/19348)) -- Use normalized tuples for fallback calculation (Stanislav Terliakov, [PR #19111](https://github.com/python/mypy/pull/19111)) -- Preserve literals when joining Literal with Instance that has matching last_known_value (Stanislav Terliakov, [PR #19279](https://github.com/python/mypy/pull/19279)) -- Allow adjacent conditionally‑defined overloads (Stanislav Terliakov, [PR #19042](https://github.com/python/mypy/pull/19042)) -- Check property decorators more strictly (Stanislav Terliakov, [PR #19313](https://github.com/python/mypy/pull/19313)) -- Support properties with generic setters (Ivan Levkivskyi, [PR #19298](https://github.com/python/mypy/pull/19298)) -- Generalize class/static method and property alias support (Ivan Levkivskyi, [PR #19297](https://github.com/python/mypy/pull/19297)) -- Re‑widen custom properties after narrowing (Ivan Levkivskyi, [PR #19296](https://github.com/python/mypy/pull/19296)) -- Avoid erasing type objects when checking runtime cover (Shantanu, [PR #19320](https://github.com/python/mypy/pull/19320)) -- Include tuple fallback in constraints built from tuple types (Stanislav Terliakov, [PR #19100](https://github.com/python/mypy/pull/19100)) -- Somewhat better isinstance support on old‑style unions (Shantanu, [PR #19714](https://github.com/python/mypy/pull/19714)) -- Improve promotions inside unions (Christoph Tyralla, [PR #19245](https://github.com/python/mypy/pull/19245)) -- Uninhabited types should have all attributes (Ivan Levkivskyi, [PR #19300](https://github.com/python/mypy/pull/19300)) -- Metaclass conflict checks improved (Robsdedude, [PR #17682](https://github.com/python/mypy/pull/17682)) -- Metaclass resolution algorithm fixes (Robsdedude, [PR #17713](https://github.com/python/mypy/pull/17713)) -- PEP 702 @deprecated: handle “combined” overloads (Christoph Tyralla, [PR #19626](https://github.com/python/mypy/pull/19626)) -- PEP 702 @deprecated: include overloads in snapshot descriptions (Christoph Tyralla, [PR #19613](https://github.com/python/mypy/pull/19613)) -- Ignore overload implementation when checking `__OP__` / `__rOP__` compatibility (Stanislav Terliakov, [PR #18502](https://github.com/python/mypy/pull/18502)) -- Fix unwrapping of assignment expressions in match subject (Marc Mueller, [PR #19742](https://github.com/python/mypy/pull/19742)) -- Omit errors for class patterns against object (Marc Mueller, [PR #19709](https://github.com/python/mypy/pull/19709)) -- Remove unnecessary error for certain match class patterns (Marc Mueller, [PR #19708](https://github.com/python/mypy/pull/19708)) -- Use union type for captured vars in or pattern (Marc Mueller, [PR #19710](https://github.com/python/mypy/pull/19710)) -- Prevent final reassignment inside match case (Omer Hadari, [PR #19496](https://github.com/python/mypy/pull/19496)) -- Support _value_ as a fallback for ellipsis Enum members (Stanislav Terliakov, [PR #19352](https://github.com/python/mypy/pull/19352)) -- Sort arguments in TypedDict overlap messages (Marc Mueller, [PR #19666](https://github.com/python/mypy/pull/19666)) -- Reset to previous statement on leaving return in semanal (Stanislav Terliakov, [PR #19642](https://github.com/python/mypy/pull/19642)) -- Add ambiguous to UninhabitedType identity for better messaging (Stanislav Terliakov, [PR #19648](https://github.com/python/mypy/pull/19648)) -- Further fix overload diagnostics for varargs/kwargs (Shantanu, [PR #19619](https://github.com/python/mypy/pull/19619)) -- Fix overload diagnostics when vararg and varkwarg both match (Shantanu, [PR #19614](https://github.com/python/mypy/pull/19614)) -- Show type variable name in “Cannot infer type argument” (Brian Schubert, [PR #19290](https://github.com/python/mypy/pull/19290)) -- Fail gracefully on unsupported template strings (PEP 750) (Brian Schubert, [PR #19700](https://github.com/python/mypy/pull/19700)) -- Revert colored argparse help for Python 3.14 (Marc Mueller, [PR #19721](https://github.com/python/mypy/pull/19721)) -- Support type‑checking a code fragment in the profile script (Jukka Lehtosalo, [PR #19379](https://github.com/python/mypy/pull/19379)) -- Fix C compiler flags in the profile self‑check script (Jukka Lehtosalo, [PR #19326](https://github.com/python/mypy/pull/19326)) -- Add a script for profiling self‑check (Linux only) (Jukka Lehtosalo, [PR #19322](https://github.com/python/mypy/pull/19322)) -- Retry PyPI upload script: skip existing files on retry (Jukka Lehtosalo, [PR #19305](https://github.com/python/mypy/pull/19305)) +- Remove deprecated --new-type-inference flag (the new algorithm has long been default) (Ivan Levkivskyi, PR [19570](https://github.com/python/mypy/pull/19570)) +- Use empty context as a fallback for return expressions when outer context misleads inference (Ivan Levkivskyi, PR [19767](https://github.com/python/mypy/pull/19767)) +- Support --strict-equality checks involving None (Christoph Tyralla, PR [19718](https://github.com/python/mypy/pull/19718)) +- Don’t show import‑related errors after a module‑level assert False (Stanislav Terliakov, PR [19347](https://github.com/python/mypy/pull/19347)) +- Fix forward refs in type parameters of over‑parameterized PEP 695 aliases (Brian Schubert, PR [19725](https://github.com/python/mypy/pull/19725)) +- Don’t expand PEP 695 aliases when checking node fullnames (Brian Schubert, PR [19699](https://github.com/python/mypy/pull/19699)) +- Don’t use outer context for or expression inference when LHS is Any (Stanislav Terliakov, PR [19748](https://github.com/python/mypy/pull/19748)) +- Interpret bare ClassVar as inferred (not Any) (Ivan Levkivskyi, PR [19573](https://github.com/python/mypy/pull/19573)) +- Recognize buffer protocol special methods (Brian Schubert, PR [19581](https://github.com/python/mypy/pull/19581)) +- Add temporary named expressions for match subjects (Stanislav Terliakov, PR [18446](https://github.com/python/mypy/pull/18446)) +- Support attribute access on enum members correctly (Stanislav Terliakov, PR [19422](https://github.com/python/mypy/pull/19422)) +- Check `__slots__` assignments on self types (Stanislav Terliakov, PR [19332](https://github.com/python/mypy/pull/19332)) +- Move self‑argument checks after decorator application (Stanislav Terliakov, PR [19490](https://github.com/python/mypy/pull/19490)) +- Infer empty list for `__slots__` and module `__all__` (Stanislav Terliakov, PR [19348](https://github.com/python/mypy/pull/19348)) +- Use normalized tuples for fallback calculation (Stanislav Terliakov, PR [19111](https://github.com/python/mypy/pull/19111)) +- Preserve literals when joining Literal with Instance that has matching last_known_value (Stanislav Terliakov, PR [19279](https://github.com/python/mypy/pull/19279)) +- Allow adjacent conditionally‑defined overloads (Stanislav Terliakov, PR [19042](https://github.com/python/mypy/pull/19042)) +- Check property decorators more strictly (Stanislav Terliakov, PR [19313](https://github.com/python/mypy/pull/19313)) +- Support properties with generic setters (Ivan Levkivskyi, PR [19298](https://github.com/python/mypy/pull/19298)) +- Generalize class/static method and property alias support (Ivan Levkivskyi, PR [19297](https://github.com/python/mypy/pull/19297)) +- Re‑widen custom properties after narrowing (Ivan Levkivskyi, PR [19296](https://github.com/python/mypy/pull/19296)) +- Avoid erasing type objects when checking runtime cover (Shantanu, PR [19320](https://github.com/python/mypy/pull/19320)) +- Include tuple fallback in constraints built from tuple types (Stanislav Terliakov, PR [19100](https://github.com/python/mypy/pull/19100)) +- Somewhat better isinstance support on old‑style unions (Shantanu, PR [19714](https://github.com/python/mypy/pull/19714)) +- Improve promotions inside unions (Christoph Tyralla, PR [19245](https://github.com/python/mypy/pull/19245)) +- Uninhabited types should have all attributes (Ivan Levkivskyi, PR [19300](https://github.com/python/mypy/pull/19300)) +- Metaclass conflict checks improved (Robsdedude, PR [17682](https://github.com/python/mypy/pull/17682)) +- Metaclass resolution algorithm fixes (Robsdedude, PR [17713](https://github.com/python/mypy/pull/17713)) +- PEP 702 @deprecated: handle “combined” overloads (Christoph Tyralla, PR [19626](https://github.com/python/mypy/pull/19626)) +- PEP 702 @deprecated: include overloads in snapshot descriptions (Christoph Tyralla, PR [19613](https://github.com/python/mypy/pull/19613)) +- Ignore overload implementation when checking `__OP__` / `__rOP__` compatibility (Stanislav Terliakov, PR [18502](https://github.com/python/mypy/pull/18502)) +- Fix unwrapping of assignment expressions in match subject (Marc Mueller, PR [19742](https://github.com/python/mypy/pull/19742)) +- Omit errors for class patterns against object (Marc Mueller, PR [19709](https://github.com/python/mypy/pull/19709)) +- Remove unnecessary error for certain match class patterns (Marc Mueller, PR [19708](https://github.com/python/mypy/pull/19708)) +- Use union type for captured vars in or pattern (Marc Mueller, PR [19710](https://github.com/python/mypy/pull/19710)) +- Prevent final reassignment inside match case (Omer Hadari, PR [19496](https://github.com/python/mypy/pull/19496)) +- Support _value_ as a fallback for ellipsis Enum members (Stanislav Terliakov, PR [19352](https://github.com/python/mypy/pull/19352)) +- Sort arguments in TypedDict overlap messages (Marc Mueller, PR [19666](https://github.com/python/mypy/pull/19666)) +- Reset to previous statement on leaving return in semanal (Stanislav Terliakov, PR [19642](https://github.com/python/mypy/pull/19642)) +- Add ambiguous to UninhabitedType identity for better messaging (Stanislav Terliakov, PR [19648](https://github.com/python/mypy/pull/19648)) +- Further fix overload diagnostics for varargs/kwargs (Shantanu, PR [19619](https://github.com/python/mypy/pull/19619)) +- Fix overload diagnostics when vararg and varkwarg both match (Shantanu, PR [19614](https://github.com/python/mypy/pull/19614)) +- Show type variable name in “Cannot infer type argument” (Brian Schubert, PR [19290](https://github.com/python/mypy/pull/19290)) +- Fail gracefully on unsupported template strings (PEP 750) (Brian Schubert, PR [19700](https://github.com/python/mypy/pull/19700)) +- Revert colored argparse help for Python 3.14 (Marc Mueller, PR [19721](https://github.com/python/mypy/pull/19721)) +- Support type‑checking a code fragment in the profile script (Jukka Lehtosalo, PR [19379](https://github.com/python/mypy/pull/19379)) +- Fix C compiler flags in the profile self‑check script (Jukka Lehtosalo, PR [19326](https://github.com/python/mypy/pull/19326)) +- Add a script for profiling self‑check (Linux only) (Jukka Lehtosalo, PR [19322](https://github.com/python/mypy/pull/19322)) +- Retry PyPI upload script: skip existing files on retry (Jukka Lehtosalo, PR [19305](https://github.com/python/mypy/pull/19305)) ### Typeshed Updates From 819a87e5ab3c483afc4ec957d0449dfe07939948 Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 04:15:48 -0400 Subject: [PATCH 06/10] minor pr link update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1971ad5583..bfc17395d163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,7 +94,7 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) - Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) - Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) -- Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19577)) +- Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19615)) ### Mypyc Improvements From bd2f3007955d8642a78deb890310f3d4daf96580 Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 11:09:10 -0400 Subject: [PATCH 07/10] minor log moves --- CHANGELOG.md | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfc17395d163..60130c12dcd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,20 +14,12 @@ You can read the full documentation for this release on [Read the Docs](http://m ### `--allow-redefinition-new` -Exposes an (experimental) command‑line flag to control whether subclass `__new__` redefinitions are accepted. This was previously an internal toggle; it’s now publicly documented via --allow-redefinition-new so advanced projects can fine‑tune behavior without internal flags -This feature was contributed by Ivan Levkivskyi (PR [19796](https://github.com/python/mypy/pull/19796)). -### Fixed‑Format Cache (experimental) +This feature was contributed by Jukka Lehtosalo. -Introduces an optional binary fixed‑format cache that’s both smaller and notably faster to load than the JSON/orjson cache. Local measurements on the PR show ~2.5× faster deserialization than orjson and reviewer benchmarks report a ~35% cached import speedup on a large workload; the flag is currently hidden/opt‑in while we iterate. Follow‑ups further shrink/optimize the format and reduce GC overhead during loads. +### Fixed‑Format Cache (experimental) -- Initial implementation and flag (hidden): --fixed-format-cache -- Tag packing and compaction: 1‑byte type/symbol tags and u8 storage -- Denser representation for common scalars (int, str) -- Lower GC pressure when reading caches -- Guardrails around constructor cache emission (compatibility) -- Expose --fixed-format-cache if compiled This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)) @@ -37,7 +29,7 @@ Mypy now implements PEP 800 Disjoint bases: it understands the @disjoint_base This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/python/mypy/pull/19678)). -### Mypy Improvements +### Mypy Performance Improvements - Improve self check performance by 1.8% (Jukka Lehtosalo, PR [19768](https://github.com/python/mypy/pull/19768), [19769](https://github.com/python/mypy/pull/19769), [19770](https://github.com/python/mypy/pull/19770)) - Use fast Python wrappers in native_internal (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765)) @@ -79,23 +71,6 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - More detailed checking of type objects in stubtest (Stephen Morton, PR [18251](https://github.com/python/mypy/pull/18251)) - Support running stubtest in non-UTF8 terminals (Stanislav Terliakovm, PR [19085](https://github.com/python/mypy/pull/19085)) -### Bug Fixes - -- Fix crash with variadic tuple arguments to a generic type (Randolf Scholz, PR [19705](https://github.com/python/mypy/pull/19705)) -- Fix crash when enable_error_code in pyproject.toml has wrong type (wyattscarpenter, PR [19494](https://github.com/python/mypy/pull/19494)) -- Fix dict assignment to a wider context when an incompatible same‑shape TypedDict exists (Stanislav Terliakov, PR [19592](https://github.com/python/mypy/pull/19592)) -- Prevent crash for dataclass with PEP 695 TypeVarTuple on Python 3.13+ (Stanislav Terliakov, PR [19565](https://github.com/python/mypy/pull/19565)) -- Fix constructor type for subclasses of Any (Ivan Levkivskyi, PR [19295](https://github.com/python/mypy/pull/19295)) -- Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, PR [19325](https://github.com/python/mypy/pull/19325)) -- Fix TypeIs negative narrowing for unions of generics (Brian Schubert, PR [18193](https://github.com/python/mypy/pull/18193)) -- dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, PR [18937](https://github.com/python/mypy/pull/18937)) -- dmypy suggest: fix interaction with `__new__` (Stanislav Terliakov, PR [18966](https://github.com/python/mypy/pull/18966)) -- dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, PR [19072](https://github.com/python/mypy/pull/19072)) -- Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) -- Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) -- Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) -- Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19615)) - ### Mypyc Improvements - Fix subclass processing in detect_undefined_bitmap (Chainfire, PR [19787](https://github.com/python/mypy/pull/19787)) @@ -153,7 +128,6 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py ### Documentation Updates - Add idlemypyextension to IDE integrations (CoolCat467, PR [18615](https://github.com/python/mypy/pull/18615)) -- Update stubinfo for latest typeshed (Shantanu, PR [19771](https://github.com/python/mypy/pull/19771)) - Document that object is often preferable to Any in APIs (wyattscarpenter, PR [19103](https://github.com/python/mypy/pull/19103)) - Include a detailed listing of flags enabled by --strict (wyattscarpenter, PR [19062](https://github.com/python/mypy/pull/19062)) - Update “common issues” (reveal_type/reveal_locals; note on orjson) (wyattscarpenter, PR [19059](https://github.com/python/mypy/pull/19059), [19058](https://github.com/python/mypy/pull/19058)) @@ -209,6 +183,21 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py - Fix C compiler flags in the profile self‑check script (Jukka Lehtosalo, PR [19326](https://github.com/python/mypy/pull/19326)) - Add a script for profiling self‑check (Linux only) (Jukka Lehtosalo, PR [19322](https://github.com/python/mypy/pull/19322)) - Retry PyPI upload script: skip existing files on retry (Jukka Lehtosalo, PR [19305](https://github.com/python/mypy/pull/19305)) +- Update stubinfo for latest typeshed (Shantanu, PR [19771](https://github.com/python/mypy/pull/19771)) +- Fix crash with variadic tuple arguments to a generic type (Randolf Scholz, PR [19705](https://github.com/python/mypy/pull/19705)) +- Fix crash when enable_error_code in pyproject.toml has wrong type (wyattscarpenter, PR [19494](https://github.com/python/mypy/pull/19494)) +- Fix dict assignment to a wider context when an incompatible same‑shape TypedDict exists (Stanislav Terliakov, PR [19592](https://github.com/python/mypy/pull/19592)) +- Prevent crash for dataclass with PEP 695 TypeVarTuple on Python 3.13+ (Stanislav Terliakov, PR [19565](https://github.com/python/mypy/pull/19565)) +- Fix constructor type for subclasses of Any (Ivan Levkivskyi, PR [19295](https://github.com/python/mypy/pull/19295)) +- Fix TypeGuard/TypeIs being forgotten when semanal defers (Brian Schubert, PR [19325](https://github.com/python/mypy/pull/19325)) +- Fix TypeIs negative narrowing for unions of generics (Brian Schubert, PR [18193](https://github.com/python/mypy/pull/18193)) +- dmypy suggest: fix incorrect signature suggestion when a type matches a module name (Brian Schubert, PR [18937](https://github.com/python/mypy/pull/18937)) +- dmypy suggest: fix interaction with `__new__` (Stanislav Terliakov, PR [18966](https://github.com/python/mypy/pull/18966)) +- dmypy suggest: support Callable / callable Protocols in decorator unwrapping (Anthony Sottile, PR [19072](https://github.com/python/mypy/pull/19072)) +- Fix missing error when redeclaring a type variable in a nested generic class (Brian Schubert, PR [18883](https://github.com/python/mypy/pull/18883)) +- Fix for overloaded type object erasure (Shantanu, PR [19338](https://github.com/python/mypy/pull/19338)) +- Fix TypeGuard with call on temporary object (Saul Shanabrook, PR [19577](https://github.com/python/mypy/pull/19577)) +- Fix crash on settable property alias (Ivan Levkivskyi, PR [19615](https://github.com/python/mypy/pull/19615)) ### Typeshed Updates From 6879f21cfd1209085b833926be3e9a5394630624 Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 11:25:29 -0400 Subject: [PATCH 08/10] added TODOs --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60130c12dcd8..ff0f6a0d3eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,13 @@ You can read the full documentation for this release on [Read the Docs](http://m ### `--allow-redefinition-new` - +TODO by Jukka This feature was contributed by Jukka Lehtosalo. ### Fixed‑Format Cache (experimental) +TODO by Jukka. This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)) From 43ec978ef6be8a43556af43f95eda5b9e4a2efa7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 15:26:54 +0000 Subject: [PATCH 09/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0f6a0d3eb3..d2c379fe2a5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ This feature was contributed by Jukka Lehtosalo. ### Fixed‑Format Cache (experimental) -TODO by Jukka. +TODO by Jukka. This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)) From d2af25eed3133b5756735896093ef3990f272ad7 Mon Sep 17 00:00:00 2001 From: KevinRK29 Date: Wed, 10 Sep 2025 11:34:45 -0400 Subject: [PATCH 10/10] added speed up metric --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c379fe2a5d..76643a0b805c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ This feature was contributed by Jukka Lehtosalo. ### Fixed‑Format Cache (experimental) -TODO by Jukka. +TODO by Jukka This feature was contributed by Ivan Levkivskyi (PR [19668](https://github.com/python/mypy/pull/19668), [19735](https://github.com/python/mypy/pull/19735), [19750](https://github.com/python/mypy/pull/19750), [19681](https://github.com/python/mypy/pull/19681), [19752](https://github.com/python/mypy/pull/19752), [19815](https://github.com/python/mypy/pull/19815)) @@ -32,6 +32,8 @@ This feature was contributed by Jelle Zijlstra (PR [19678](https://github.com/py ### Mypy Performance Improvements +Mypy 1.18 includes numerous performance improvements, resulting in a 38% overall speedup compared to 1.17 + - Improve self check performance by 1.8% (Jukka Lehtosalo, PR [19768](https://github.com/python/mypy/pull/19768), [19769](https://github.com/python/mypy/pull/19769), [19770](https://github.com/python/mypy/pull/19770)) - Use fast Python wrappers in native_internal (Ivan Levkivskyi, PR [19765](https://github.com/python/mypy/pull/19765)) - Use macros in native_internal hot paths (Ivan Levkivskyi, PR [19757](https://github.com/python/mypy/pull/19757))