Debian Codegraph @

doc/whatsnew/3/3.3/index.rst

raw
1
2 ***************************
3 What's New in Pylint 3.3
4 ***************************
5
6 .. toctree::
7 :maxdepth: 2
8
9 :Release:3.3
10 :Date: 2024-09-20
11
12 Summary -- Release highlights
13 =============================
14
15 .. towncrier release notes start
16
17 What's new in Pylint 3.3.9?
18 ---------------------------
19 Release date: 2025-10-05
20
21
22 False Positives Fixed
23 ---------------------
24
25 - Fix :ref:`used-before-assignment` for PEP 695 type aliases and parameters.
26
27 Closes #9815 (`#9815 <https://github.com/pylint-dev/pylint/issues/9815>`_)
28
29 - No longer flag undeprecated functions in ``importlib.resources`` as deprecated.
30
31 Closes #10593 (`#10593 <https://github.com/pylint-dev/pylint/issues/10593>`_)
32
33 - Fix false positive ``inconsistent-return-statements`` when using ``quit()`` or ``exit()`` functions.
34
35 Closes #10508 (`#10508 <https://github.com/pylint-dev/pylint/issues/10508>`_)
36
37 - Fix false positive ``undefined-variable`` (E0602) for for-loop variable shadowing patterns like ``for item in item:`` when the variable was previously defined.
38
39 Closes #10562 (`#10562 <https://github.com/pylint-dev/pylint/issues/10562>`_)
40
41
42
43 Other Bug Fixes
44 ---------------
45
46 - Fixed crash in ``unnecessary-list-index-lookup`` when starting an enumeration using
47 minus the length of an iterable inside a dict comprehension when the len call was only
48 made in this dict comprehension, and not elsewhere. Also changed the approach,
49 to use inference in all cases but the simple ones, so we don't have to fix crashes
50 one by one for arbitrarily complex expressions in enumerate.
51
52 Closes #10510 (`#10510 <https://github.com/pylint-dev/pylint/issues/10510>`_)
53
54
55
56 What's new in Pylint 3.3.8?
57 ---------------------------
58 Release date: 2025-08-09
59
60 This patch release includes an exceptional fix for a false negative issue.
61 For details, see: https://github.com/pylint-dev/pylint/pull/10482#issuecomment-3164514082
62
63 False Positives Fixed
64 ---------------------
65
66 - Fix false positives for :ref:`possibly-used-before-assignment` when variables are exhaustively
67 assigned within a :keyword:`match` block.
68
69 Closes #9668 (`#9668 <https://github.com/pylint-dev/pylint/issues/9668>`_)
70
71 - Fix false positive for :ref:`missing-raises-doc` and :ref:`missing-yield-doc` when the method length is less than docstring-min-length.
72
73 Refs #10104 (`#10104 <https://github.com/pylint-dev/pylint/issues/10104>`_)
74
75 - Fix a false positive for :ref:`unused-variable` when multiple except handlers bind the same name under a try block.
76
77 Closes #10426 (`#10426 <https://github.com/pylint-dev/pylint/issues/10426>`_)
78
79
80
81 False Negatives Fixed
82 ---------------------
83
84 - Fix false-negative for :ref:`used-before-assignment` with ``from __future__ import annotations`` in function definitions.
85
86 Refs #10482 (`#10482 <https://github.com/pylint-dev/pylint/issues/10482>`_)
87
88
89
90 Other Bug Fixes
91 ---------------
92
93 - Fix a bug in Pyreverse where aggregations and associations were included in diagrams regardless of the selected --filter-mode (such as PUB_ONLY, ALL, etc.).
94
95 Closes #10373 (`#10373 <https://github.com/pylint-dev/pylint/issues/10373>`_)
96
97 - Fix double underscores erroneously rendering as bold in pyreverse's Mermaid output.
98
99 Closes #10402 (`#10402 <https://github.com/pylint-dev/pylint/issues/10402>`_)
100
101
102
103 What's new in Pylint 3.3.7?
104 ---------------------------
105 Release date: 2025-05-04
106
107
108 False Positives Fixed
109 ---------------------
110
111 - Comparisons between two calls to `type()` won't raise an :ref:`unidiomatic-typecheck` warning anymore, consistent with the behavior applied only for ``==`` previously.
112
113 Closes #10161 (`#10161 <https://github.com/pylint-dev/pylint/issues/10161>`_)
114
115
116
117 Other Bug Fixes
118 ---------------
119
120 - Fixed a crash when importing a class decorator that did not exist with the same name as a class attribute after the class definition.
121
122 Closes #10105 (`#10105 <https://github.com/pylint-dev/pylint/issues/10105>`_)
123
124 - Fix a crash caused by malformed format strings when using `.format` with keyword arguments.
125
126 Closes #10282 (`#10282 <https://github.com/pylint-dev/pylint/issues/10282>`_)
127
128 - Using a slice as a class decorator now raises a :ref:`not-callable` message instead of crashing. A lot of checks that dealt with decorators (too many to list) are now shortcut if the decorator can't immediately be inferred to a function or class definition.
129
130 Closes #10334 (`#10334 <https://github.com/pylint-dev/pylint/issues/10334>`_)
131
132
133
134 Other Changes
135 -------------
136
137 - The algorithm used for :ref:`no-member` suggestions is now more efficient and cuts the
138 calculation when the distance score is already above the threshold.
139
140 Refs #10277 (`#10277 <https://github.com/pylint-dev/pylint/issues/10277>`_)
141
142
143
144 What's new in Pylint 3.3.6?
145 ---------------------------
146 Release date: 2025-03-20
147
148
149 False Positives Fixed
150 ---------------------
151
152 - Fix a false positive for :ref:`used-before-assignment` when an inner function's return type
153 annotation is a class defined at module scope.
154
155 Closes #9391 (`#9391 <https://github.com/pylint-dev/pylint/issues/9391>`_)
156
157
158
159 What's new in Pylint 3.3.5?
160 ---------------------------
161 Release date: 2025-03-09
162
163
164 False Positives Fixed
165 ---------------------
166
167 - Fix false positives for :ref:`use-implicit-booleaness-not-comparison`, :ref:`use-implicit-booleaness-not-comparison-to-string`
168 and :ref:`use-implicit-booleaness-not-comparison-to-zero` when chained comparisons are checked.
169
170 Closes #10065 (`#10065 <https://github.com/pylint-dev/pylint/issues/10065>`_)
171
172 - Fix a false positive for :ref:`invalid-getnewargs-ex-returned` when the tuple or dict has been assigned to a name.
173
174 Closes #10208 (`#10208 <https://github.com/pylint-dev/pylint/issues/10208>`_)
175
176 - Remove :py:mod:`getopt` and :py:mod:`optparse` from the list of deprecated modules.
177
178 Closes #10211 (`#10211 <https://github.com/pylint-dev/pylint/issues/10211>`_)
179
180
181
182 Other Bug Fixes
183 ---------------
184
185 - Fixed conditional import x.y causing false positive :ref:`possibly-used-before-assignment`.
186
187 Closes #10081 (`#10081 <https://github.com/pylint-dev/pylint/issues/10081>`_)
188
189 - Fix a crash when something besides a class is found in an except handler.
190
191 Closes #10106 (`#10106 <https://github.com/pylint-dev/pylint/issues/10106>`_)
192
193 - Fixed raising :ref:`invalid-name` when using camelCase for private methods with two leading underscores.
194
195 Closes #10189 (`#10189 <https://github.com/pylint-dev/pylint/issues/10189>`_)
196
197
198
199 Other Changes
200 -------------
201
202 - Upload release assets to PyPI via Trusted Publishing.
203
204 Closes #10256 (`#10256 <https://github.com/pylint-dev/pylint/issues/10256>`_)
205
206
207
208 What's new in Pylint 3.3.4?
209 ---------------------------
210 Release date: 2025-01-28
211
212
213 Other Bug Fixes
214 ---------------
215
216 - Fixes "skipped files" count calculation; the previous method was displaying an arbitrary number.
217
218 Closes #10073 (`#10073 <https://github.com/pylint-dev/pylint/issues/10073>`_)
219
220 - Fixes a crash that occurred when pylint was run in a container on a host with cgroupsv2 and restrictions on CPU usage.
221
222 Closes #10103 (`#10103 <https://github.com/pylint-dev/pylint/issues/10103>`_)
223
224 - Relaxed the requirements for isort so pylint can benefit from isort 6.
225
226 Closes #10203 (`#10203 <https://github.com/pylint-dev/pylint/issues/10203>`_)
227
228
229
230 What's new in Pylint 3.3.3?
231 ---------------------------
232 Release date: 2024-12-23
233
234
235 False Positives Fixed
236 ---------------------
237
238 - Fix false positives for :ref:`undefined-variable` for classes using Python 3.12
239 generic type syntax.
240
241 Closes #9335 (`#9335 <https://github.com/pylint-dev/pylint/issues/9335>`_)
242
243 - Fix a false positive for :ref:`use-implicit-booleaness-not-len`. No lint should be emitted for
244 generators (:py:func:`len` is not defined for generators).
245
246 Refs #10100 (`#10100 <https://github.com/pylint-dev/pylint/issues/10100>`_)
247
248
249
250 Other Bug Fixes
251 ---------------
252
253 - Fix ``Unable to import 'collections.abc' (import-error)`` on Python 3.13.1.
254
255 Closes #10112 (`#10112 <https://github.com/pylint-dev/pylint/issues/10112>`_)
256
257
258
259 What's new in Pylint 3.3.2?
260 ---------------------------
261 Release date: 2024-12-01
262
263
264 False Positives Fixed
265 ---------------------
266
267 - Fix a false positive for :ref:`potential-index-error` when an indexed iterable
268 contains a starred element that evaluates to more than one item.
269
270 Closes #10076 (`#10076 <https://github.com/pylint-dev/pylint/issues/10076>`_)
271
272
273
274 Other Bug Fixes
275 ---------------
276
277 - Fixes the issue with --source-root option not working when the source files are in a subdirectory of the source root (e.g. when using a /src layout).
278
279 Closes #10026 (`#10026 <https://github.com/pylint-dev/pylint/issues/10026>`_)
280
281
282
283 What's new in Pylint 3.3.1?
284 ---------------------------
285 Release date: 2024-09-24
286
287
288 False Positives Fixed
289 ---------------------
290
291 - Fix regression causing some f-strings to not be inferred as strings.
292
293 Closes #9947 (`#9947 <https://github.com/pylint-dev/pylint/issues/9947>`_)
294
295
296
297 What's new in Pylint 3.3.0?
298 ---------------------------
299 Release date: 2024-09-20
300
301
302 Changes requiring user actions
303 ------------------------------
304
305 - We migrated ``symilar`` to argparse, from getopt, so the error and help output changed
306 (for the better). We exit with 2 instead of sometime 1, sometime 2. The error output
307 is not captured by the runner anymore. It's not possible to use a value for the
308 boolean options anymore (``--ignore-comments 1`` should become ``--ignore-comments``).
309
310 Refs #9731 (`#9731 <https://github.com/pylint-dev/pylint/issues/9731>`_)
311
312
313
314 New Features
315 ------------
316
317 - Add new :ref:`declare-non-slot` error which reports when a class has a `__slots__` member and a type hint on the class is not present in `__slots__`.
318
319 Refs #9499 (`#9499 <https://github.com/pylint-dev/pylint/issues/9499>`_)
320
321
322
323 New Checks
324 ----------
325
326 - Added :ref:`too-many-positional-arguments` to allow distinguishing the configuration for too many
327 total arguments (with keyword-only params specified after `*`) from the configuration
328 for too many positional-or-keyword or positional-only arguments.
329
330 As part of evaluating whether this check makes sense for your project, ensure you
331 adjust the value of `--max-positional-arguments`.
332
333 Closes #9099 (`#9099 <https://github.com/pylint-dev/pylint/issues/9099>`_)
334
335 - Add :ref:`using-exception-groups-in-unsupported-version` and
336 :ref:`using-generic-type-syntax-in-unsupported-version` for uses of Python 3.11+ or
337 3.12+ features on lower supported versions provided with ``--py-version``.
338
339 Closes #9791 (`#9791 <https://github.com/pylint-dev/pylint/issues/9791>`_)
340
341 - Add :ref:`using-assignment-expression-in-unsupported-version` for uses of ``:=`` (walrus operator)
342 on Python versions below 3.8 provided with ``--py-version``.
343
344 Closes #9820 (`#9820 <https://github.com/pylint-dev/pylint/issues/9820>`_)
345
346 - Add :ref:`using-positional-only-args-in-unsupported-version` for uses of positional-only args on
347 Python versions below 3.8 provided with ``--py-version``.
348
349 Closes #9823 (`#9823 <https://github.com/pylint-dev/pylint/issues/9823>`_)
350
351 - Add :ref:`unnecessary-default-type-args` to the ``typing`` extension to detect the use
352 of unnecessary default type args for :py:class:`typing.Generator` and :py:class:`typing.AsyncGenerator`.
353
354 Refs #9938 (`#9938 <https://github.com/pylint-dev/pylint/issues/9938>`_)
355
356
357
358 False Negatives Fixed
359 ---------------------
360
361 - Fix computation of never-returning function: :py:data:`typing.Never` is handled in addition to :py:data:`typing.NoReturn`, and priority is given to the explicit `--never-returning-functions` option.
362
363 Closes #7565. (`#7565 <https://github.com/pylint-dev/pylint/issues/7565>`_)
364
365 - Fix a false negative for :ref:`await-outside-async` when await is inside Lambda.
366
367 Refs #9653 (`#9653 <https://github.com/pylint-dev/pylint/issues/9653>`_)
368
369 - Fix a false negative for :ref:`duplicate-argument-name` by including ``positional-only``, ``*args`` and ``**kwargs`` arguments in the check.
370
371 Closes #9669 (`#9669 <https://github.com/pylint-dev/pylint/issues/9669>`_)
372
373 - Fix false negative for :ref:`multiple-statements` when multiple statements are present on :keyword:`else` and :keyword:`finally` lines of :keyword:`try`.
374
375 Refs #9759 (`#9759 <https://github.com/pylint-dev/pylint/issues/9759>`_)
376
377 - Fix false negatives when :py:func::`isinstance` does not have exactly two arguments.
378 pylint now emits a :ref:`too-many-function-args` or :ref:`no-value-for-parameter`
379 appropriately for :py:func:`isinstance` calls.
380
381 Closes #9847 (`#9847 <https://github.com/pylint-dev/pylint/issues/9847>`_)
382
383
384
385 Other Bug Fixes
386 ---------------
387
388 - `--enable` with `--disable=all` now produces an error, when an unknown msg code is used. Internal `pylint` messages are no longer affected by `--disable=all`.
389
390 Closes #9403 (`#9403 <https://github.com/pylint-dev/pylint/issues/9403>`_)
391
392 - Impossible to compile regexes for paths in the configuration or argument given to pylint won't crash anymore but
393 raise an argparse error and display the error message from ``re.compile`` instead.
394
395 Closes #9680 (`#9680 <https://github.com/pylint-dev/pylint/issues/9680>`_)
396
397 - Fix a bug where a ``tox.ini`` file with pylint configuration was ignored and it exists in the current directory.
398
399 ``.cfg`` and ``.ini`` files containing a ``Pylint`` configuration may now use a section named ``[pylint]``. This enhancement impacts the scenario where these file types are used as defaults when they are present and have not been explicitly referred to, using the ``--rcfile`` option.
400
401 Closes #9727 (`#9727 <https://github.com/pylint-dev/pylint/issues/9727>`_)
402
403 - Improve file discovery for directories that are not python packages.
404
405 Closes #9764 (`#9764 <https://github.com/pylint-dev/pylint/issues/9764>`_)
406
407
408
409 Other Changes
410 -------------
411
412 - Remove support for launching pylint with Python 3.8.
413 Code that supports Python 3.8 can still be linted with the ``--py-version=3.8`` setting.
414
415 Refs #9774 (`#9774 <https://github.com/pylint-dev/pylint/issues/9774>`_)
416
417 - Add support for Python 3.13.
418
419 Refs #9852 (`#9852 <https://github.com/pylint-dev/pylint/issues/9852>`_)
420
421
422
423 Internal Changes
424 ----------------
425
426 - All variables, classes, functions and file names containing the word 'similar', when it was,
427 in fact, referring to 'symilar' (the standalone program for the :ref:`duplicate-code` check) were renamed
428 to 'symilar'.
429
430 Closes #9734 (`#9734 <https://github.com/pylint-dev/pylint/issues/9734>`_)
431
432 - Remove old-style classes (Python 2) code and remove check for new-style class since everything is new-style in Python 3. Updated doc for exception checker to remove reference to new style class.
433
434 Refs #9925 (`#9925 <https://github.com/pylint-dev/pylint/issues/9925>`_)