Debian Codegraph @

doc/whatsnew/4/4.0/index.rst

raw
1
2 ***************************
3 What's New in Pylint 4.0
4 ***************************
5
6 .. toctree::
7 :maxdepth: 2
8
9 :Release:4.0
10 :Date: 2025-10-12
11
12 Summary -- Release highlights
13 =============================
14
15 - Pylint now supports Python 3.14.
16
17 - Pylint's inference engine (``astroid``) is now much more precise,
18 understanding implicit booleanness and ternary expressions. (Thanks @zenlyj!)
19
20 Consider this example:
21
22 .. code-block:: python
23
24 class Result:
25 errors: dict | None = None
26
27 result = Result()
28 if result.errors:
29 result.errors[field_key]
30 # inference engine understands result.errors cannot be None
31 # pylint no longer raises unsubscriptable-object
32
33 The required ``astroid`` version is now 4.0.0. See the
34 `astroid changelog <https://pylint.readthedocs.io/projects/astroid/en/latest/changelog.html#what-s-new-in-astroid-4-0-0>`_
35 for additional fixes, features, and performance improvements applicable to pylint.
36
37 - Handling of ``invalid-name`` at the module level was patchy. Now,
38 module-level constants that are reassigned are treated as variables and checked
39 against ``--variable-rgx`` rather than ``--const-rgx``. Module-level lists,
40 sets, and objects can pass against either regex.
41
42 Here, ``LIMIT`` is reassigned, so pylint only uses ``--variable-rgx``:
43
44 .. code-block:: python
45
46 LIMIT = 500 # [invalid-name]
47 if sometimes:
48 LIMIT = 1 # [invalid-name]
49
50 If this is undesired, refactor using *exclusive* assignment so that it is
51 evident that this assignment happens only once:
52
53 .. code-block:: python
54
55 if sometimes:
56 LIMIT = 1
57 else:
58 LIMIT = 500 # exclusive assignment: uses const regex, no warning
59
60 Lists, sets, and objects still pass against either ``const-rgx`` or ``variable-rgx``
61 even if reassigned, but are no longer completely skipped:
62
63 .. code-block:: python
64
65 MY_LIST = []
66 my_list = []
67 My_List = [] # [invalid-name]
68
69 Remember to adjust the
70 `regexes <https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/invalid-name.html>`_
71 and
72 `allow lists <https://pylint.readthedocs.io/en/latest/user_guide/configuration/all-options.html#good-names>`_
73 to your liking.
74
75 .. towncrier release notes start
76
77 What's new in Pylint 4.0.6?
78 ---------------------------
79 Release date: 2026-06-14
80
81
82 False Positives Fixed
83 ---------------------
84
85 - ``implicit-str-concat`` is no longer emitted for an implicit concatenation of
86 a raw string with a non-raw one (e.g. ``r"\d" "\n"``). Such literals cannot be
87 merged into a single string, so the concatenation is intentional rather than a
88 forgotten comma.
89
90 Closes #6663 (`#6663 <https://github.com/pylint-dev/pylint/issues/6663>`_)
91
92 - Fix a false positive for ``invalid-name`` (C0103) where the default
93 ``typevar-rgx`` rejected ``TypeVar`` names containing digits, such as
94 ``Ec2T``.
95
96 Closes #8499 (`#8499 <https://github.com/pylint-dev/pylint/issues/8499>`_)
97
98 - Fix a false positive for ``too-many-arguments`` in (non-static) methods and classmethods.
99
100 Closes #8675 (`#8675 <https://github.com/pylint-dev/pylint/issues/8675>`_)
101
102 - Fix a false positive for ``no-member`` when a value is inferred to several
103 possible types and at least one of them defines a dynamic ``__getattr__``.
104
105 Closes #9833 (`#9833 <https://github.com/pylint-dev/pylint/issues/9833>`_)
106
107 - Fix a false positive for ``function-redefined`` (E0102) when reusing names that
108 match ``dummy-variables-rgx`` (such as ``_``), which is common for
109 ``pytest-bdd`` step definitions. This restores the behavior from before pylint
110 4.0.0; as a consequence the false negative fixed in #9894 is reintroduced for
111 functions whose name matches ``dummy-variables-rgx``.
112
113 Closes #10665 (`#10665 <https://github.com/pylint-dev/pylint/issues/10665>`_)
114
115 - Fix ``undefined-variable`` false positive when a name used as a ``metaclass``
116 argument in a nested class is referenced again later in the module.
117
118 Closes #10823 (`#10823 <https://github.com/pylint-dev/pylint/issues/10823>`_)
119
120 - Fix a false positive for ``unused-variable`` where global variables matching
121 ``dummy-variables-rgx`` were still reported as unused when
122 ``allow-global-unused-variables`` was disabled.
123
124 Closes #10890 (`#10890 <https://github.com/pylint-dev/pylint/issues/10890>`_)
125
126 - Fix a false positive for ``bad-dunder-name`` when there is a user-defined ``__suppress_context__`` attribute on exception subclasses.
127
128 Closes #10960 (`#10960 <https://github.com/pylint-dev/pylint/issues/10960>`_)
129
130 - Fix ``used-before-assignment`` false positive for names bound by ``from X import *`` in every branch of an ``if``/``elif``/``else`` chain.
131
132 Refs #10980 (`#10980 <https://github.com/pylint-dev/pylint/issues/10980>`_)
133
134 - Check for metaclass __call__ signature when evaluating arguments of a class call.
135
136 Closes #11032 (`#11032 <https://github.com/pylint-dev/pylint/issues/11032>`_)
137
138 - Fix false positive ``method-hidden`` when ``cached_property`` is imported directly with ``from functools import cached_property``.
139
140 Refs #11037 (`#11037 <https://github.com/pylint-dev/pylint/issues/11037>`_)
141
142
143
144 Other Bug Fixes
145 ---------------
146
147 - Fix the suggestion of ``unnecessary-comprehension`` for a dict comprehension
148 that iterates a dict directly, e.g. ``{a: b for a, b in d}``. Iterating a dict
149 yields its keys, so the suggestion is now ``dict(d.keys())`` instead of the
150 incorrect ``dict(d)``, which would simply copy ``d``.
151
152 Closes #8256 (`#8256 <https://github.com/pylint-dev/pylint/issues/8256>`_)
153
154 - Fix a crash in ``consider-using-enumerate`` when the ``for`` loop target is an attribute (e.g. ``for self.idx in range(len(x))``) rather than a simple variable name.
155
156 Closes #10099 (`#10099 <https://github.com/pylint-dev/pylint/issues/10099>`_)
157
158 - Fix crash when checking ``attribute-defined-outside-init`` on classes that inherit from a base class pylint cannot fully analyze.
159
160 Closes #10892 (`#10892 <https://github.com/pylint-dev/pylint/issues/10892>`_)
161
162 - Fix ``add_message`` silently overwriting an explicit ``col_offset=0`` (or any other zero-valued ``line``/``end_lineno``/``end_col_offset``) with the AST node's value. The internal ``_add_one_message`` helper used a falsey check (``if not col_offset:``) to detect an omitted argument, which incorrectly treated a legitimate ``0`` the same as ``None``. It now uses an identity check against ``None``.
163
164 Refs #11020 (`#11020 <https://github.com/pylint-dev/pylint/issues/11020>`_)
165
166 - Fix a crash in the name checker when a non-constant value is passed as the ``covariant`` or ``contravariant`` argument of a ``TypeVar``.
167
168 Closes #11022 (`#11022 <https://github.com/pylint-dev/pylint/issues/11022>`_)
169
170 - Fix a crash in the variable checker when a name resolves to a dataclass-synthesized ``__init__``, which has no line number.
171
172 Closes #11023 (`#11023 <https://github.com/pylint-dev/pylint/issues/11023>`_)
173
174 - Fix a crash in the variables checker when ``NotImplemented`` is used as the test of an ``if`` statement, which raised a ``TypeError`` in a boolean context on Python 3.14.
175
176 Closes #11025 (`#11025 <https://github.com/pylint-dev/pylint/issues/11025>`_)
177
178 - Avoided a crash from the implicit booleaness checker for ``len()`` calls without arguments.
179
180 Closes #11028 (`#11028 <https://github.com/pylint-dev/pylint/issues/11028>`_)
181
182 - Fix a crash in the variables checker when a class declares a metaclass whose
183 attribute-access chain does not bottom out at a name (e.g.
184 ``class C(metaclass=None._)``).
185 Originally reported as ``pylint-dev/astroid#3066``.
186
187 Refs #11031 (`#11031 <https://github.com/pylint-dev/pylint/issues/11031>`_)
188
189 - Fix a crash in the name checker when a chained assignment of a ``TypeAlias``
190 value has a non-name target such as a ``Subscript`` (for example
191 ``a[0] = b = TypeAlias``).
192
193 Closes #11056 (`#11056 <https://github.com/pylint-dev/pylint/issues/11056>`_)
194
195 - Fix a crash in the deprecated checker when ``__import__`` is called with a
196 non-string constant argument (for example ``__import__(1)``).
197
198 Closes #11059 (`#11059 <https://github.com/pylint-dev/pylint/issues/11059>`_)
199
200 - Avoid crashing when enum member inference fails while checking enum subclasses.
201
202 Closes #11069 (`#11069 <https://github.com/pylint-dev/pylint/issues/11069>`_)
203
204 - Prevent a crash in ``unexpected-keyword-arg`` analysis when
205 ``infer_call_result()`` raises ``InferenceError`` while inspecting
206 decorator return signatures.
207
208 Closes #11070 (`#11070 <https://github.com/pylint-dev/pylint/issues/11070>`_)
209
210 - Fix a crash in the typecheck checker when a class uses a non-class object
211 (for example a function) as its ``metaclass=`` argument.
212
213 Closes #11071 (`#11071 <https://github.com/pylint-dev/pylint/issues/11071>`_)
214
215 - Allow digits in ParamSpec and TypeVarTuple names for `invalid-name` check.
216
217 The default `paramspec-rgx` and `typevartuple-rgx` patterns rejected names
218 containing digits (e.g. ``Ec2P``, ``S3Ts``), emitting a false ``invalid-name``
219 (C0103). Allow digits in the lowercase segments, consistent with the
220 ``typevar`` and ``typealias`` patterns.
221
222 Closes #11090 (`#11090 <https://github.com/pylint-dev/pylint/issues/11090>`_)
223
224
225
226 Performance Improvements
227 ------------------------
228
229 - The duplicate-code checker no longer runs when its message (R0801) is disabled, even if ``reports=yes`` is set. Previously, the checker's report (RP0801) would cause the expensive similarity computation to run regardless.
230
231 Closes #3443 (`#3443 <https://github.com/pylint-dev/pylint/issues/3443>`_)
232
233
234
235 What's new in Pylint 4.0.5?
236 ---------------------------
237 Release date: 2026-02-20
238
239
240 False Positives Fixed
241 ---------------------
242
243 - Fix possibly-used-before-assignment false positive when using self.fail() in tests.
244
245 Closes #10743 (`#10743 <https://github.com/pylint-dev/pylint/issues/10743>`_)
246
247 - Fixed false positive for ``logging-unsupported-format`` when no arguments are provided to logging functions.
248
249 According to Python's logging documentation, no formatting is performed when no arguments are supplied, so strings like ``logging.error("%test")`` are valid.
250
251 Closes #10752 (`#10752 <https://github.com/pylint-dev/pylint/issues/10752>`_)
252
253 - Fix a false positive for ``invalid-name`` where a dataclass field typed with ``Final``
254 was evaluated against the ``class_const`` regex instead of the ``class_attribute`` regex.
255
256 Closes #10790 (`#10790 <https://github.com/pylint-dev/pylint/issues/10790>`_)
257
258 - Avoid emitting `unspecified-encoding` (W1514) when `py-version` is 3.15+.
259
260 Refs #10791 (`#10791 <https://github.com/pylint-dev/pylint/issues/10791>`_)
261
262
263
264 Other Bug Fixes
265 ---------------
266
267 - Fix `--known_third_party` config being ignored.
268
269 Closes #10801 (`#10801 <https://github.com/pylint-dev/pylint/issues/10801>`_)
270
271 - Fixed dynamic color mapping for "fail-on" messages when using multiple reporter/output formats.
272
273 Closes #10825 (`#10825 <https://github.com/pylint-dev/pylint/issues/10825>`_)
274
275 - dependency on isort is now set to <9, permitting to use isort 8.
276
277 Closes #10857 (`#10857 <https://github.com/pylint-dev/pylint/issues/10857>`_)
278
279
280
281 What's new in Pylint 4.0.4?
282 --------------------------------
283 Release date: 2025-11-30
284
285
286 False Positives Fixed
287 ---------------------
288
289 - Fixed false positive for ``invalid-name`` where module-level constants were incorrectly classified as variables when a class-level attribute with the same name exists.
290
291 Closes #10719 (`#10719 <https://github.com/pylint-dev/pylint/issues/10719>`_)
292
293 - Fix a false positive for ``invalid-name`` on an UPPER_CASED name inside an ``if`` branch that assigns an object.
294
295 Closes #10745 (`#10745 <https://github.com/pylint-dev/pylint/issues/10745>`_)
296
297
298
299 What's new in Pylint 4.0.3?
300 ---------------------------
301 Release date: 2025-11-13
302
303
304 False Positives Fixed
305 ---------------------
306
307 - Add Enum dunder methods ``_generate_next_value_``, ``_missing_``, ``_numeric_repr_``, ``_add_alias_``, and ``_add_value_alias_`` to the list passed to ``--good-dunder-names``.
308
309 Closes #10435 (`#10435 <https://github.com/pylint-dev/pylint/issues/10435>`_)
310
311 - Fixed false positive for ``invalid-name`` with ``typing.Annotated``.
312
313 Closes #10696 (`#10696 <https://github.com/pylint-dev/pylint/issues/10696>`_)
314
315 - Fix false positive for ``f-string-without-interpolation`` with template strings
316 when using format spec.
317
318 Closes #10702 (`#10702 <https://github.com/pylint-dev/pylint/issues/10702>`_)
319
320 - Fix a false positive when an UPPER_CASED class attribute was raising an
321 ``invalid-name`` when typed with ``Final``.
322
323 Closes #10711 (`#10711 <https://github.com/pylint-dev/pylint/issues/10711>`_)
324
325 - Fix a false positive for ``unbalanced-tuple-unpacking`` when a tuple is assigned to a function call and the structure of the function's return value is ambiguous.
326
327 Closes #10721 (`#10721 <https://github.com/pylint-dev/pylint/issues/10721>`_)
328
329
330
331 Other Bug Fixes
332 ---------------
333
334 - Make 'ignore' option work as expected again.
335
336 Closes #10669 (`#10669 <https://github.com/pylint-dev/pylint/issues/10669>`_)
337
338 - Fix crash for ``consider-using-assignment-expr`` when a variable annotation without assignment
339 is used as the ``if`` test expression.
340
341 Closes #10707 (`#10707 <https://github.com/pylint-dev/pylint/issues/10707>`_)
342
343 - Fix crash for ``prefer-typing-namedtuple`` and ``consider-math-not-float`` when
344 a ``slice`` object is called.
345
346 Closes #10708 (`#10708 <https://github.com/pylint-dev/pylint/issues/10708>`_)
347
348
349
350 What's new in Pylint 4.0.2?
351 --------------------------------
352 Release date: 2025-10-20
353
354
355 False Positives Fixed
356 ---------------------
357
358 - Fix false positive for :ref:`invalid-name` on a partially uninferable module-level constant.
359
360 Closes #10652 (`#10652 <https://github.com/pylint-dev/pylint/issues/10652>`_)
361
362 - Fix a false positive for :ref:`invalid-name` on exclusive module-level assignments
363 composed of three or more branches. We won't raise :ref:`disallowed-name` on module-level names that can't be inferred
364 until a further refactor to remove this false negative is done.
365
366 Closes #10664 (`#10664 <https://github.com/pylint-dev/pylint/issues/10664>`_)
367
368 - Fix false positive for :ref:`invalid-name` for ``TypedDict`` instances.
369
370 Closes #10672 (`#10672 <https://github.com/pylint-dev/pylint/issues/10672>`_)
371
372
373
374 What's new in Pylint 4.0.1?
375 ---------------------------
376 Release date: 2025-10-14
377
378
379 False Positives Fixed
380 ---------------------
381
382 - Exclude ``__all__`` and ``__future__.annotations`` from ``unused-variable``.
383
384 Closes #10019 (`#10019 <https://github.com/pylint-dev/pylint/issues/10019>`_)
385
386 - Fix false-positive for ``bare-name-capture-pattern`` if a case guard is used.
387
388 Closes #10647 (`#10647 <https://github.com/pylint-dev/pylint/issues/10647>`_)
389
390 - Check enums created with the ``Enum()`` functional syntax to pass against the
391 ``--class-rgx`` for the :ref:`invalid-name` check, like other enums.
392
393 Closes #10660 (`#10660 <https://github.com/pylint-dev/pylint/issues/10660>`_)
394
395
396
397 What's new in Pylint 4.0.0?
398 ---------------------------
399 Release date: 2025-10-12
400
401
402 Breaking Changes
403 ----------------
404
405 - ``invalid-name`` now distinguishes module-level constants that are assigned only once
406 from those that are reassigned and now applies ``--variable-rgx`` to the latter. Values
407 other than literals (lists, sets, objects) can pass against either the constant or
408 variable regexes (e.g. "LOGGER" or "logger" but not "LoGgEr").
409
410 Remember that ``--good-names`` or ``--good-names-rgxs`` can be provided to explicitly
411 allow good names.
412
413 Closes #3585 (`#3585 <https://github.com/pylint-dev/pylint/issues/3585>`_)
414
415 - The unused ``pylintrc`` argument to ``PyLinter.__init__()`` is deprecated
416 and will be removed.
417
418 Refs #6052 (`#6052 <https://github.com/pylint-dev/pylint/issues/6052>`_)
419
420 - Commented out code blocks such as ``# bar() # TODO: remove dead code`` will no longer emit ``fixme``.
421
422 Refs #9255 (`#9255 <https://github.com/pylint-dev/pylint/issues/9255>`_)
423
424 - ``pyreverse`` ``Run`` was changed to no longer call ``sys.exit()`` in its ``__init__``.
425 You should now call ``Run(args).run()`` which will return the exit code instead.
426 Having a class that always raised a ``SystemExit`` exception was considered a bug.
427
428 Normal usage of pyreverse through the CLI will not be affected by this change.
429
430 Refs #9689 (`#9689 <https://github.com/pylint-dev/pylint/issues/9689>`_)
431
432 - The ``suggestion-mode`` option was removed, as pylint now always emits user-friendly hints instead
433 of false-positive error messages. You should remove it from your conf if it's defined.
434
435 Refs #9962 (`#9962 <https://github.com/pylint-dev/pylint/issues/9962>`_)
436
437 - The ``async.py`` checker module has been renamed to ``async_checker.py`` since ``async`` is a Python keyword
438 and cannot be imported directly. This allows for better testing and extensibility of the async checker functionality.
439
440 Refs #10071 (`#10071 <https://github.com/pylint-dev/pylint/issues/10071>`_)
441
442 - The message-id of ``continue-in-finally`` was changed from ``E0116`` to ``W0136``. The warning is
443 now emitted for every Python version since it will raise a syntax warning in Python 3.14.
444 See `PEP 765 - Disallow return/break/continue that exit a finally block <https://peps.python.org/pep-0765/>`_.
445
446 Refs #10480 (`#10480 <https://github.com/pylint-dev/pylint/issues/10480>`_)
447
448 - Removed support for ``nmp.NaN`` alias for ``numpy.NaN`` being recognized in ':ref:`nan-comparison`'. Use ``np`` or ``numpy`` instead.
449
450 Refs #10583 (`#10583 <https://github.com/pylint-dev/pylint/issues/10583>`_)
451
452 - Version requirement for ``isort`` has been bumped to >=5.0.0.
453 The internal compatibility for older ``isort`` versions exposed via ``pylint.utils.IsortDriver`` has
454 been removed.
455
456 Refs #10637 (`#10637 <https://github.com/pylint-dev/pylint/issues/10637>`_)
457
458
459
460 New Features
461 ------------
462
463 - ``comparison-of-constants`` now uses the unicode from the ast instead of reformatting from
464 the node's values preventing some bad formatting due to ``utf-8`` limitation. The message now uses
465 ``"`` instead of ``'`` to better work with what the python ast returns.
466
467 Refs #8736 (`#8736 <https://github.com/pylint-dev/pylint/issues/8736>`_)
468
469 - Enhanced pyreverse to properly distinguish between UML relationship types (association, aggregation, composition) based on object ownership semantics. Type annotations without assignment are now treated as associations, parameter assignments as aggregations, and object instantiation as compositions.
470
471 Closes #9045
472 Closes #9267 (`#9045 <https://github.com/pylint-dev/pylint/issues/9045>`_)
473
474 - The ``fixme`` check can now search through docstrings as well as comments, by using
475 ``check-fixme-in-docstring = true`` in the ``[tool.pylint.miscellaneous]`` section.
476
477 Closes #9255 (`#9255 <https://github.com/pylint-dev/pylint/issues/9255>`_)
478
479 - The ``use-implicit-booleaness-not-x`` checks now distinguish between comparisons
480 used in boolean contexts and those that are not, enabling them to provide more accurate refactoring suggestions.
481
482 Closes #9353 (`#9353 <https://github.com/pylint-dev/pylint/issues/9353>`_)
483
484 - The verbose option now outputs the filenames of the files that have been checked.
485 Previously, it only included the number of checked and skipped files.
486
487 Closes #9357 (`#9357 <https://github.com/pylint-dev/pylint/issues/9357>`_)
488
489 - colorized reporter now colorizes messages/categories that have been configured as ``fail-on`` in red inverse.
490 This makes it easier to quickly find the errors that are causing pylint CI job failures.
491
492 Closes #9898 (`#9898 <https://github.com/pylint-dev/pylint/issues/9898>`_)
493
494 - Enhanced support for @property decorator in pyreverse to correctly display return types of annotated properties when generating class diagrams.
495
496 Closes #10057 (`#10057 <https://github.com/pylint-dev/pylint/issues/10057>`_)
497
498 - Add --max-depth option to pyreverse to control diagram complexity. A depth of 0 shows only top-level packages, 1 shows one level of subpackages, etc.
499 This helps manage visualization of large codebases by limiting the depth of displayed packages and classes.
500
501 Refs #10077 (`#10077 <https://github.com/pylint-dev/pylint/issues/10077>`_)
502
503 - Handle deferred evaluation of annotations in Python 3.14.
504
505 Closes #10149 (`#10149 <https://github.com/pylint-dev/pylint/issues/10149>`_)
506
507 - Enhanced pyreverse to properly detect aggregations for comprehensions (list, dict, set, generator).
508
509 Closes #10236 (`#10236 <https://github.com/pylint-dev/pylint/issues/10236>`_)
510
511 - ``pyreverse``: add support for colorized output when using output format ``mmd`` (MermaidJS) and ``html``.
512
513 Closes #10242 (`#10242 <https://github.com/pylint-dev/pylint/issues/10242>`_)
514
515 - pypy 3.11 is now officially supported.
516
517 Refs #10287 (`#10287 <https://github.com/pylint-dev/pylint/issues/10287>`_)
518
519 - Add support for Python 3.14.
520
521 Refs #10467 (`#10467 <https://github.com/pylint-dev/pylint/issues/10467>`_)
522
523 - Add naming styles for ``ParamSpec`` and ``TypeVarTuple`` that align with the ``TypeVar`` style.
524
525 Refs #10541 (`#10541 <https://github.com/pylint-dev/pylint/issues/10541>`_)
526
527
528
529 New Checks
530 ----------
531
532 - Add ``match-statements`` checker and the following message:
533 ``bare-name-capture-pattern``.
534 This will emit an error message when a name capture pattern is used in a match statement which would make the remaining patterns unreachable.
535 This code is a SyntaxError at runtime.
536
537 Closes #7128 (`#7128 <https://github.com/pylint-dev/pylint/issues/7128>`_)
538
539 - Add new check ``async-context-manager-with-regular-with`` to detect async context managers used with regular ``with`` statements instead of ``async with``.
540
541 Refs #10408 (`#10408 <https://github.com/pylint-dev/pylint/issues/10408>`_)
542
543 - Add ``break-in-finally`` warning. Using ``break`` inside the ``finally`` clause
544 will raise a syntax warning in Python 3.14.
545 See `PEP 765 - Disallow return/break/continue that exit a finally block <https://peps.python.org/pep-0765/>`_.
546
547 Refs #10480 (`#10480 <https://github.com/pylint-dev/pylint/issues/10480>`_)
548
549 - Add new checks for invalid uses of class patterns in :keyword:`match`.
550
551 * :ref:`invalid-match-args-definition` is emitted if :py:data:`object.__match_args__` isn't a tuple of strings.
552 * :ref:`too-many-positional-sub-patterns` if there are more positional sub-patterns than specified in :py:data:`object.__match_args__`.
553 * :ref:`multiple-class-sub-patterns` if there are multiple sub-patterns for the same attribute.
554
555 Refs #10559 (`#10559 <https://github.com/pylint-dev/pylint/issues/10559>`_)
556
557 - Add additional checks for suboptimal uses of class patterns in :keyword:`match`.
558
559 * :ref:`match-class-bind-self` is emitted if a name is bound to ``self`` instead of
560 using an ``as`` pattern.
561 * :ref:`match-class-positional-attributes` is emitted if a class pattern has positional
562 attributes when keywords could be used.
563
564 Refs #10587 (`#10587 <https://github.com/pylint-dev/pylint/issues/10587>`_)
565
566 - Add a ``consider-math-not-float`` message. ``float("nan")`` and ``float("inf")`` are slower
567 than their counterpart ``math.inf`` and ``math.nan`` by a factor of 4 (notwithstanding
568 the initial import of math) and they are also not well typed when using mypy.
569 This check also catches typos in float calls as a side effect.
570
571 The :ref:`pylint.extensions.code_style` need to be activated for this check to work.
572
573 Refs #10621 (`#10621 <https://github.com/pylint-dev/pylint/issues/10621>`_)
574
575
576
577 False Positives Fixed
578 ---------------------
579
580 - Fix a false positive for ``used-before-assignment`` when a variable defined under
581 an ``if`` and via a named expression (walrus operator) is used later when guarded
582 under the same ``if`` test.
583
584 Closes #10061 (`#10061 <https://github.com/pylint-dev/pylint/issues/10061>`_)
585
586 - Fix :ref:`no-name-in-module` for members of ``concurrent.futures`` with Python 3.14.
587
588 Closes #10632 (`#10632 <https://github.com/pylint-dev/pylint/issues/10632>`_)
589
590
591
592 False Negatives Fixed
593 ---------------------
594
595 - Fix false negative for ``used-before-assignment`` when a ``TYPE_CHECKING`` import is used as a type annotation prior to erroneous usage.
596
597 Refs #8893 (`#8893 <https://github.com/pylint-dev/pylint/issues/8893>`_)
598
599 - Match cases are now counted as edges in the McCabe graph and will increase the complexity accordingly.
600
601 Refs #9667 (`#9667 <https://github.com/pylint-dev/pylint/issues/9667>`_)
602
603 - Check module-level constants with type annotations for ``invalid-name``.
604 Remember to adjust ``const-naming-style`` or ``const-rgx`` to your liking.
605
606 Closes #9770 (`#9770 <https://github.com/pylint-dev/pylint/issues/9770>`_)
607
608 - Fix false negative where function-redefined (E0102) was not reported for functions with a leading underscore.
609
610 Closes #9894 (`#9894 <https://github.com/pylint-dev/pylint/issues/9894>`_)
611
612 - We now raise a ``logging-too-few-args`` for format string with no
613 interpolation arguments at all (i.e. for something like ``logging.debug("Awaiting process %s")``
614 or ``logging.debug("Awaiting process {pid}")``). Previously we did not raise for such case.
615
616 Closes #9999 (`#9999 <https://github.com/pylint-dev/pylint/issues/9999>`_)
617
618 - Fix false negative for ``used-before-assignment`` when a function is defined inside a ``TYPE_CHECKING`` guard block and used later.
619
620 Closes #10028 (`#10028 <https://github.com/pylint-dev/pylint/issues/10028>`_)
621
622 - Fix a false negative for ``possibly-used-before-assignment`` when a variable is conditionally defined
623 and later assigned to a type-annotated variable.
624
625 Closes #10421 (`#10421 <https://github.com/pylint-dev/pylint/issues/10421>`_)
626
627 - Fix false negative for ``deprecated-module`` when a ``__import__`` method is used instead of ``import`` sentence.
628
629 Refs #10453 (`#10453 <https://github.com/pylint-dev/pylint/issues/10453>`_)
630
631 - Count match cases for ``too-many-branches`` check.
632
633 Refs #10542 (`#10542 <https://github.com/pylint-dev/pylint/issues/10542>`_)
634
635 - Fix false-negative where :ref:`unused-import` was not reported for names referenced in a preceding ``global`` statement.
636
637 Refs #10633 (`#10633 <https://github.com/pylint-dev/pylint/issues/10633>`_)
638
639
640
641 Other Bug Fixes
642 ---------------
643
644 - When displaying unicode with surrogates (or other potential ``UnicodeEncodeError``),
645 pylint will now display a '?' character (using ``encode(encoding="utf-8", errors="replace")``)
646 instead of crashing. The functional tests classes are also updated to handle this case.
647
648 Closes #8736. (`#8736 <https://github.com/pylint-dev/pylint/issues/8736>`_)
649
650 - Fixed unidiomatic-typecheck only checking left-hand side.
651
652 Closes #10217 (`#10217 <https://github.com/pylint-dev/pylint/issues/10217>`_)
653
654 - Fix a crash caused by malformed format strings when using ``.format`` with keyword arguments.
655
656 Closes #10282 (`#10282 <https://github.com/pylint-dev/pylint/issues/10282>`_)
657
658 - Fix false positive ``inconsistent-return-statements`` when using ``quit()`` or ``exit()`` functions.
659
660 Closes #10508 (`#10508 <https://github.com/pylint-dev/pylint/issues/10508>`_)
661
662 - Fix a crash in :ref:`nested-min-max` when using ``builtins.min`` or ``builtins.max``
663 instead of ``min`` or ``max`` directly.
664
665 Closes #10626 (`#10626 <https://github.com/pylint-dev/pylint/issues/10626>`_)
666
667 - Fixed a crash in :ref:`unnecessary-dict-index-lookup` when the index of an enumerated list
668 was deleted inside a for loop.
669
670 Closes #10627 (`#10627 <https://github.com/pylint-dev/pylint/issues/10627>`_)
671
672
673
674 Other Changes
675 -------------
676
677 - Remove support for launching pylint with Python 3.9.
678 Code that supports Python 3.9 can still be linted with the ``--py-version=3.9`` setting.
679
680 Refs #10405 (`#10405 <https://github.com/pylint-dev/pylint/issues/10405>`_)
681
682
683
684 Internal Changes
685 ----------------
686
687 - Modified test framework to allow for different test output for different Python versions.
688
689 Refs #10382 (`#10382 <https://github.com/pylint-dev/pylint/issues/10382>`_)