Debian Codegraph @

ChangeLog

raw
1 ===================
2 astroid's ChangeLog
3 ===================
4
5
6 What's New in astroid 4.2.0?
7 ============================
8 Release date: TBA
9
10
11
12 What's New in astroid 4.1.2?
13 ============================
14 Release date: TBA
15
16
17
18 What's New in astroid 4.1.1?
19 ============================
20 Release date: 2026-02-22
21
22 * Let `UnboundMethodModel` inherit from `FunctionModel` to improve inference of
23 dunder methods for unbound methods.
24
25 Refs #2741
26
27 * Filter ``Unknown`` from ``UnboundMethod`` and ``Super`` special attribute
28 lookup to prevent placeholder nodes from leaking during inference.
29
30 Refs #2741
31
32
33 What's New in astroid 4.1.0?
34 ============================
35 Release date: 2026-02-08
36
37 * Add support for equality constraints (``==``, ``!=``) in inference.
38 Closes pylint-dev/pylint#3632
39 Closes pylint-dev/pylint#3633
40
41 * Ensure ``ast.JoinedStr`` nodes are ``Uninferable`` when the ``ast.FormattedValue`` is
42 ``Uninferable``. This prevents ``unexpected-keyword-arg`` messages in Pylint
43 where the ``Uninferable`` string appeared in function arguments that were
44 constructed dynamically.
45
46 Closes pylint-dev/pylint#10822
47
48 * Add support for type constraints (`isinstance(x, y)`) in inference.
49
50 Closes pylint-dev/pylint#1162
51 Closes pylint-dev/pylint#4635
52 Closes pylint-dev/pylint#10469
53
54 * Make `type.__new__()` raise clear errors instead of returning `None`
55
56 * Move object dunder methods from ``FunctionModel`` to ``ObjectModel`` to make them
57 available on all object types, not just functions.
58
59 Closes #2742
60 Closes #2741
61 Closes pylint-dev/pylint#6094
62
63 * ``lineno`` and ``end_lineno`` are now available on ``Arguments``.
64
65 * Add helper to iterate over all annotations nodes of function arguments,
66 ``Arguments.get_annotations()``.
67
68 Refs #2860
69
70 * Skip direct parent when determining the ``Decorator`` frame.
71
72 Refs pylint-dev/pylint#8425
73
74 * Add simple command line interface for astroid to output generated AST.
75 Use with ``python -m astroid``.
76
77 * Fix incorrect type inference for ``super().method()`` calls that return ``Self``.
78 Previously, astroid would infer the parent class type instead of the child class type,
79 causing pylint E1101 false positives in method chaining scenarios.
80
81 Closes #457
82
83 * Add missing ``dtype`` and ``casting`` parameters to ``numpy.concatenate`` brain.
84
85 Closes #2870
86
87 * Fix ability to detect .py modules inside PATH directories on Windows
88 described by a UNC path with a trailing backslash (`\`)
89 - Example: modutils.modpath_from_file(filename=r"\\Mac\Code\tests\test_resources.py", path=["\\mac\code\"]) == ['tests', 'test_resources']
90
91 * Fix ``random.sample`` inference crash when sequence contains uninferable elements.
92
93 Closes #2518
94
95 * Fix ``random.sample`` crash when cloning ``ClassDef`` or ``FunctionDef`` nodes.
96
97 Closes #2923
98
99
100 What's New in astroid 4.0.4?
101 ============================
102 Release date: 2026-02-07
103
104 * Fix ``is_namespace()`` crash when search locations contain ``pathlib.Path`` objects.
105
106 Closes #2942
107
108 What's New in astroid 4.0.3?
109 ============================
110 Release date: 2026-01-03
111
112 * Fix inference of ``IfExp`` (ternary expression) nodes to avoid prematurely narrowing
113 results in the face of inference ambiguity.
114
115 Closes #2899
116
117 * Fix base class inference for dataclasses using the PEP 695 typing syntax.
118
119 Refs pylint-dev/pylint#10788
120
121
122 What's New in astroid 4.0.2?
123 ============================
124 Release date: 2025-11-09
125
126 * Handle FunctionDef blockstart_tolineno edge cases correctly.
127
128 Refs #2880
129
130 * Add ``HTTPMethod`` enum support to brain module for Python 3.11+.
131
132 Refs pylint-dev/pylint#10624
133 Closes #2877
134
135 What's New in astroid 4.0.1?
136 ============================
137 Release date: 2025-10-11
138
139 * Suppress ``SyntaxWarning`` for invalid escape sequences and return in finally on
140 Python 3.14 when parsing modules.
141
142 * Assign ``Import`` and ``ImportFrom`` nodes to module locals if used with ``global``.
143
144 Closes pylint-dev/pylint#10632
145
146
147 What's New in astroid 4.0.0?
148 ============================
149 Release date: 2025-10-05
150
151 * Support constraints from ternary expressions in inference.
152
153 Closes pylint-dev/pylint#9729
154
155 * Handle deprecated `bool(NotImplemented)` cast in const nodes.
156
157 * Add support for boolean truthiness constraints (`x`, `not x`) in inference.
158
159 Closes pylint-dev/pylint#9515
160
161 * Fix false positive `invalid-name` on `attrs` classes with `ClassVar` annotated variables.
162
163 Closes pylint-dev/pylint#10525
164
165 * Prevent crash when parsing deeply nested parentheses causing MemoryError in python's built-in ast.
166
167 Closes #2643
168
169 * Fix crash when inferring namedtuple with invalid field name looking like f-string formatting.
170
171 Closes #2519
172
173 * Fix false positive no-member in except * handler.
174
175 Closes pylint-dev/pylint#9056
176
177 * Fix crash when comparing invalid dict literal
178
179 Closes #2522
180
181 * Removed internal functions ``infer_numpy_member``, ``name_looks_like_numpy_member``, and
182 ``attribute_looks_like_numpy_member`` from ``astroid.brain.brain_numpy_utils``.
183
184 * To alleviate circular imports, the ``manager`` argument to ``AstroidBuilder()`` is now required.
185
186 * Constants now have a parent of ``nodes.SYNTHETIC_ROOT``.
187
188 * Fix crashes with large positive and negative list multipliers.
189
190 Closes #2521
191 Closes #2523
192
193 * Fix precedence of `path` arg in `modpath_from_file_with_callback` to be higher than `sys.path`
194
195 * Following a deprecation period, the ``future`` argument was removed from ``statement()`` and ``frame()``.
196
197 * Improve consistency of ``JoinedStr`` inference by not raising ``InferenceError`` and
198 returning either ``Uninferable`` or a fully resolved ``Const``.
199
200 Closes #2621
201
202 * Fix crash when typing._alias() call is missing arguments.
203
204 Closes #2513
205
206 * Remove support for Python 3.9 (and constant `PY310_PLUS`).
207
208 * Include subclasses of standard property classes as `property` decorators
209
210 Closes #10377
211
212 * Modify ``astroid.bases`` and ``tests.test_nodes`` to reflect that `enum.property` was added in Python 3.11, not 3.10
213
214 * Fix incorrect result in `_get_relative_base_path` when the target directory name starts with the base path
215
216 Closes #2608
217
218 * The brain for nose was dropped. nose has been deprecated for 10 years and the brain required some maintenance.
219
220 Refs #2765
221
222 * Fix a crash when the root of a node is not a module but is unknown.
223
224 Closes #2672
225
226 * Add basic support for ``ast.TemplateStr`` and ``ast.Interpolation`` added in Python 3.14.
227
228 Refs #2789
229
230 * Add support for type parameter defaults added in Python 3.13.
231
232 * Improve ``as_string()`` representation for ``TypeVar``, ``ParamSpec`` and ``TypeVarTuple`` nodes, as well as
233 type parameter in ``ClassDef``, ``FuncDef`` and ``TypeAlias`` nodes (PEP 695).
234
235 * Astroid now correctly supports the ``exceptions`` attribute of ``ExceptionGroup``.
236
237 Closes pylint-dev/pylint#8985
238 Closes pylint-dev/pylint#10558
239
240 * Deprecate importing node classes from ``astroid`` directly. This will be removed in v5.
241 It's recommended to import them from ``astroid.nodes`` instead.
242
243 Refs #2837
244
245
246 What's New in astroid 3.3.11?
247 =============================
248 Release date: 2025-07-13
249
250 * Fix a crash when parsing an empty arbitrary expression with ``extract_node`` (``extract_node("__()")``).
251
252 Closes #2734
253
254 * Fix a crash when parsing a slice called in a decorator on a function that is also decorated with
255 a known ``six`` decorator.
256
257 Closes #2721
258
259 What's New in astroid 3.3.10?
260 =============================
261 Release date: 2025-05-10
262
263 * Avoid importing submodules sharing names with standard library modules.
264
265 Closes #2684
266
267 * Fix bug where ``pylint code.custom_extension`` would analyze ``code.py`` or ``code.pyi`` instead if they existed.
268
269 Closes pylint-dev/pylint#3631
270
271
272 What's New in astroid 3.3.9?
273 ============================
274 Release date: 2025-03-09
275
276 * Fix crash when `sys.modules` contains lazy loader objects during checking.
277
278 Closes #2686
279 Closes pylint-dev/pylint#8589
280
281 * Upload release assets to PyPI via Trusted Publishing.
282
283 Refs pylint-dev/pylint#10256
284
285
286 What's New in astroid 3.3.8?
287 ============================
288 Release date: 2024-12-23
289
290 * Fix inability to import `collections.abc` in python 3.13.1. The reported fixes in astroid 3.3.6
291 and 3.3.7 did not actually fix this issue.
292
293 Closes pylint-dev/pylint#10112
294
295
296 What's New in astroid 3.3.7?
297 ============================
298 Release date: 2024-12-20
299
300 This release was yanked.
301
302 * Fix inability to import `collections.abc` in python 3.13.1. The reported fix in astroid 3.3.6
303 did not actually fix this issue.
304
305 Closes pylint-dev/pylint#10112
306
307
308 What's New in astroid 3.3.6?
309 ============================
310 Release date: 2024-12-08
311
312 * Fix inability to import `collections.abc` in python 3.13.1.
313 _It was later found that this did not resolve the linked issue. It was fixed in astroid 3.3.7_
314
315 Closes pylint-dev/pylint#10112
316
317 * Fix crash when typing._alias() call is missing arguments.
318
319 Closes #2513
320
321
322 What's New in astroid 3.3.5?
323 ============================
324 Release date: 2024-10-04
325
326 * Control setting local nodes outside of the supposed local's constructor.
327
328 Closes #1490
329
330 * Fix Python 3.13 compatibility re: `collections.abc`
331
332 Closes pylint-dev/pylint#10000
333
334
335 What's New in astroid 3.3.4?
336 ============================
337 Release date: 2024-09-23
338
339 * Fix regression with f-string inference.
340
341 Closes pylint-dev/pylint#9947
342
343 * Fix bug with ``manager.clear_cache()`` not fully clearing cache.
344
345 Refs https://github.com/pylint-dev/pylint/pull/9932#issuecomment-2364985551
346
347 * Fix a crash from inferring empty format specs.
348
349 Closes pylint-dev/pylint#9945
350
351
352 What's New in astroid 3.3.3?
353 ============================
354 Release date: 2024-09-20
355
356 * Fix inference regression with property setters.
357
358 Closes pylint-dev/pylint#9811
359
360 * Add annotation-only instance attributes to attrs classes to fix `no-member` false positives.
361
362 Closes #2514
363
364
365 What's New in astroid 3.3.2?
366 ============================
367 Release date: 2024-08-11
368
369 * Restore support for soft-deprecated members of the ``typing`` module with python 3.13.
370
371 Refs pylint-dev/pylint#9852
372
373
374 What's New in astroid 3.3.1?
375 ============================
376 Release date: 2024-08-06
377
378 * Fix a crash introduced in 3.3.0 involving invalid format strings.
379
380 Closes #2492
381
382
383 What's New in astroid 3.3.0?
384 ============================
385 Release date: 2024-08-04
386
387 * Add support for Python 3.13.
388
389 * Remove support for Python 3.8 (and constants `PY38`, `PY39_PLUS`, and `PYPY_7_3_11_PLUS`).
390
391 Refs #2443
392
393 * Add the ``__annotations__`` attribute to the ``ClassDef`` object model.
394
395 Closes pylint-dev/pylint#7126
396
397 * Implement inference for JoinedStr and FormattedValue
398
399 * Add support for ``ssl.OP_LEGACY_SERVER_CONNECT`` (new in Python 3.12).
400
401 Closes pylint-dev/pylint#9849
402
403
404 What's New in astroid 3.2.4?
405 ============================
406 Release date: 2024-07-20
407
408 * Avoid reporting unary/binary op type errors when inference is ambiguous.
409
410 Closes #2467
411
412
413 What's New in astroid 3.2.3?
414 ============================
415 Release date: 2024-07-11
416
417 * Fix ``AssertionError`` when inferring a property consisting of a partial function.
418
419 Closes pylint-dev/pylint#9214
420
421
422 What's New in astroid 3.2.2?
423 ============================
424 Release date: 2024-05-20
425
426 * Improve inference for generic classes using the PEP 695 syntax (Python 3.12).
427
428 Closes pylint-dev/pylint#9406
429
430
431 What's New in astroid 3.2.1?
432 ============================
433 Release date: 2024-05-16
434
435 * Fix ``RecursionError`` in ``infer_call_result()`` for certain ``__call__`` methods.
436
437 Closes pylint-dev/pylint#9139
438
439 * Add ``AstroidManager.prefer_stubs`` attribute to control the astroid 3.2.0 feature that prefers stubs.
440
441 Refs pylint-dev/pylint#9626
442 Refs pylint-dev/pylint#9623
443
444
445 What's New in astroid 3.2.0?
446 ============================
447 Release date: 2024-05-07
448
449 * ``.pyi`` stub files are now preferred over ``.py`` files when resolving imports, (except for numpy).
450
451 Closes pylint-dev/#9185
452
453 * ``igetattr()`` returns the last same-named function in a class (instead of
454 the first). This avoids false positives in pylint with ``@overload``.
455
456 Closes #1015
457 Refs pylint-dev/pylint#4696
458
459 * Adds ``module_denylist`` to ``AstroidManager`` for modules to be skipped during AST
460 generation. Modules in this list will cause an ``AstroidImportError`` to be raised
461 when an AST for them is requested.
462
463 Refs pylint-dev/pylint#9442
464
465 * Make ``astroid.interpreter._import.util.is_namespace`` only consider modules
466 using a loader set to ``NamespaceLoader`` or ``None`` as namespaces.
467 This fixes a problem that ``six.moves`` brain was not effective if ``six.moves``
468 was already imported.
469
470 Closes #1107
471
472
473 What's New in astroid 3.1.0?
474 ============================
475 Release date: 2024-02-23
476
477 * Include PEP 695 (Python 3.12) generic type syntax nodes in ``get_children()``,
478 allowing checkers to visit them.
479
480 Refs pylint-dev/pylint#9193
481
482 * Add ``__main__`` as a possible inferred value for ``__name__`` to improve
483 control flow inference around ``if __name__ == "__main__":`` guards.
484
485 Closes #2071
486
487 * Following a deprecation period, the ``names`` arg to the ``Import`` constructor and
488 the ``op`` arg to the ``BoolOp`` constructor are now required, and the ``doc`` args
489 to the ``PartialFunction`` and ``Property`` constructors have been removed (call
490 ``postinit(doc_node=...)`` instead.)
491
492 * Following a deprecation announced in astroid 1.5.0, the alias ``AstroidBuildingException`` is removed in favor of ``AstroidBuildingError``.
493
494 * Include modname in AST warnings. Useful for ``invalid escape sequence`` warnings
495 with Python 3.12.
496
497 * ``RecursionError`` is now trapped and logged out as ``UserWarning`` during astroid node transformations with instructions about raising the system recursion limit.
498
499 Closes pylint-dev/pylint#8842
500
501 * Suppress ``SyntaxWarning`` for invalid escape sequences on Python 3.12 when parsing modules.
502
503 Closes pylint-dev/pylint#9322
504
505
506 What's New in astroid 3.0.3?
507 ============================
508 Release date: 2024-02-04
509
510 * Fix type of ``UnicodeDecodeError.object`` inferred as ``str`` instead of ``bytes``.
511
512 Closes pylint-dev/pylint#9342
513
514 * Fix ``no-member`` false positives for ``args`` and ``kwargs`` on ``ParamSpec`` under Python 3.12.
515
516 Closes pylint-dev/pylint#9401
517
518
519 What's New in astroid 3.0.2?
520 ============================
521 Release date: 2023-12-12
522
523 * Avoid duplicate inference results for some uses of ``typing.X`` constructs like
524 ``Tuple[Optional[int], ...]``. This was causing pylint to occasionally omit
525 messages like ``deprecated-typing-alias``.
526
527 Closes pylint-dev/pylint#9220
528
529
530 What's New in astroid 3.0.1?
531 ============================
532 Release date: 2023-10-15
533
534 * Fix crashes linting code using PEP 695 (Python 3.12) generic type syntax.
535
536 Closes pylint-dev/pylint#9098
537
538
539 What's New in astroid 3.0.0?
540 =============================
541 Release date: 2023-09-26
542
543 * Add support for Python 3.12, including PEP 695 type parameter syntax.
544
545 Closes #2201
546
547 * Remove support for Python 3.7.
548
549 Refs #2137
550
551 * Use the global inference cache when inferring, even without an explicit
552 ``InferenceContext``. This is a significant performance improvement given how
553 often methods default to ``None`` for the context argument. (Linting ``astroid``
554 itself now takes ~5% less time on Python 3.12; other projects requiring more
555 complex inference calculations will see greater speedups.)
556
557 Refs #529
558
559 * Following a deprecation period starting in astroid 2.7.0, the ``astroid.node_classes``
560 and ``astroid.scoped_nodes`` modules have been removed in favor of ``astroid.nodes.node_classes``
561 and ``astroid.nodes.scoped_nodes``.
562
563 Closes #1072
564
565 * Following a deprecation period starting in astroid 2.12.0, the ``astroid.mixins`` module
566 has been removed in favor of ``astroid.nodes._base_nodes`` (private).
567
568 Refs #1633
569
570 * Return all existing arguments when calling ``Arguments.arguments()``. This also means ``find_argname`` will now
571 use the whole list of arguments for its search.
572
573 Closes #2213
574
575 * Exclude class attributes from the ``__members__`` container of an ``Enum`` class when they are
576 ``nodes.AnnAssign`` nodes with no assigned value.
577
578 Refs pylint-dev/pylint#7402
579
580 * Remove ``@cached`` and ``@cachedproperty`` decorator (just use ``@cached_property`` from the stdlib).
581
582 Closes #1780
583 Refs #2140
584
585 * Remove the ``inference`` module. Node inference methods are now in the module
586 defining the node, rather than being associated to the node afterward.
587
588 Closes #679
589
590 * Move ``LookupMixIn`` to ``astroid.nodes._base_nodes`` and make it private.
591
592 * Remove the shims for ``OperationError``, ``BinaryOperationError``, and ``UnaryOperationError``
593 in ``exceptions``. They were moved to ``util`` in astroid 1.5.0.
594
595 * Move ``safe_infer()`` from ``helpers`` to ``util``. This avoids some circular imports.
596
597 * Reduce file system access in ``ast_from_file()``.
598
599 * Reduce time to ``import astroid`` by delaying ``astroid_bootstrapping()`` until
600 the first instantiation of ``AstroidBuilder``.
601
602 Closes #2161
603
604 * Make ``igetattr()`` idempotent. This addresses some reports of varying results
605 when running pylint with ``--jobs``.
606
607 Closes pylint-dev/pylint#4356
608 Refs #7
609
610 * Fix incorrect cache keys for inference results, thereby correctly inferring types
611 for calls instantiating types dynamically.
612
613 Closes #1828
614 Closes pylint-dev/pylint#7464
615 Closes pylint-dev/pylint#8074
616
617 * Fix interrupted ``InferenceContext`` call chains, thereby addressing performance
618 problems when linting ``sqlalchemy``.
619
620 Closes pylint-dev/pylint#8150
621
622 * ``nodes.FunctionDef`` no longer inherits from ``nodes.Lambda``.
623 This is a breaking change but considered a bug fix as the nodes did not share the same
624 API and were not interchangeable.
625
626 We have tried to minimize the amount of breaking changes caused by this change
627 but some are unavoidable.
628
629 * ``infer_call_result`` now shares the same interface across all implementations. Namely:
630 ```python
631 def infer_call_result(
632 self,
633 caller: SuccessfulInferenceResult | None,
634 context: InferenceContext | None = None,
635 ) -> Iterator[InferenceResult]:
636 ```
637
638 This is a breaking change for ``nodes.FunctionDef`` where previously ``caller`` had a default of
639 ``None``. Passing ``None`` again will not create a behaviour change.
640 The breaking change allows us to better type and re-use the method within ``astroid``.
641
642 * Improved signature of the ``__init__`` and ``__postinit__`` methods of most nodes.
643 This includes making ``lineno``, ``col_offset``, ``end_lineno``, ``end_col_offset`` and ``parent``
644 required arguments for ``nodes.NodeNG`` and its subclasses.
645 For most other nodes, arguments of their ``__postinit__`` methods have been made required to better
646 represent how they would normally be constructed by the standard library ``ast`` module.
647 The following nodes were changed or updated:
648 - ``nodes.AnnAssign``
649 - ``nodes.Arguments``
650 - ``nodes.Assign``
651 - ``nodes.AssignAttr``
652 - ``nodes.AssignName``
653 - ``nodes.Attribute``
654 - ``nodes.AugAssign``
655 - ``nodes.Await``
656 - ``nodes.BaseContainer``
657 - ``nodes.BinOp``
658 - ``nodes.Call``
659 - ``nodes.ClassDef``
660 - ``nodes.Compare``
661 - ``nodes.Comprehension``
662 - ``nodes.Decorators``
663 - ``nodes.Delete``
664 - ``nodes.DelAttr``
665 - ``nodes.DelName``
666 - ``nodes.Dict``
667 - ``nodes.DictComp``
668 - ``nodes.ExceptHandler``
669 - ``nodes.Expr``
670 - ``nodes.For``
671 - ``nodes.FunctionDef``
672 - ``nodes.GeneratorExp``
673 - ``nodes.If``
674 - ``nodes.IfExp``
675 - ``nodes.Keyword``
676 - ``nodes.Lambda``
677 - ``nodes.ListComp``
678 - ``nodes.Module``
679 - ``nodes.Name``
680 - ``nodes.NodeNG``
681 - ``nodes.Raise``
682 - ``nodes.Return``
683 - ``nodes.SetComp``
684 - ``nodes.Slice``
685 - ``nodes.Starred``
686 - ``objects.Super``, we also added the ``call`` parameter to its ``__init__`` method.
687 - ``nodes.Subscript``
688 - ``nodes.UnaryOp``
689 - ``nodes.While``
690 - ``nodes.Yield``
691
692 These changes involve breaking changes to their API but should be considered bug fixes. We
693 now make arguments required when they are instead of always providing defaults.
694
695 * ``nodes.If.self.is_orelse`` has been removed as it was never set correctly and therefore
696 provided a false value.
697
698 * Remove dependency on ``wrapt``.
699
700 * Remove dependency on ``lazy_object_proxy``. This includes the removal
701 of the associated ``lazy_import``, ``lazy_descriptor`` and ``proxy_alias`` utility functions.
702
703 * ``CallSite._unpack_args`` and ``CallSite._unpack_keywords`` now use ``safe_infer()`` for
704 better inference and fewer false positives.
705
706 Closes pylint-dev/pylint#8544
707
708 * Add ``attr.Factory`` to the recognized class attributes for classes decorated with ``attrs``.
709
710 Closes pylint-dev/pylint#4341
711
712 * ``infer_property()`` now observes the same property-specific workaround as ``infer_functiondef``.
713
714 Refs #1490
715
716 * Remove unused and / or deprecated constants:
717 - ``astroid.bases.BOOL_SPECIAL_METHOD``
718 - ``astroid.bases.BUILTINS``
719 - ``astroid.const.BUILTINS``
720 - ``astroid.const.PY38_PLUS``
721 - ``astroid.const.Load``
722 - ``astroid.const.Store``
723 - ``astroid.const.Del``
724
725 Refs #2141
726
727 * ``frame()`` raises ``ParentMissingError`` and ``statement()`` raises ``StatementMissing`` for
728 missing parents regardless of the value of the ``future`` argument (which gave this behavior
729 already).
730
731 The ``future`` argument to each method is deprecated and will be removed in astroid 4.0.
732
733 Refs #1217
734
735 * Remove deprecated ``Ellipsis``, ``ExtSlice``, ``Index`` nodes.
736
737 Refs #2152
738
739 * Remove deprecated ``is_sys_guard`` and ``is_typing_guard`` methods.
740
741 Refs #2153
742
743 * Remove deprecated ``doc`` attribute for ``Module``, ``ClassDef``, and ``FunctionDef``.
744 Use the ``doc_node`` attribute instead.
745
746 Refs #2154
747
748 * Add new ``nodes.Try`` to better match Python AST. Replaces the ``TryExcept``
749 and ``TryFinally`` nodes which have been removed.
750
751 * Publicize ``NodeNG.repr_name()`` to facilitate finding a node's nice name.
752
753 Refs pylint-dev/pylint#8598
754
755 * Fix false positives for ``no-member`` and ``invalid-name`` when using the ``_name_``, ``_value_`` and ``_ignore_`` sunders in Enums.
756
757 Closes pylint-dev/pylint#9015
758
759
760 What's New in astroid 2.15.8?
761 =============================
762 Release date: 2023-09-26
763
764 * Fix a regression in 2.15.7 for ``unsubscriptable-object``.
765
766 Closes #2305
767 Closes pylint-dev/pylint#9069
768
769
770 What's New in astroid 2.15.7?
771 =============================
772 Release date: 2023-09-23
773
774 * Fix a crash when inferring a ``typing.TypeVar`` call.
775
776 Closes pylint-dev/pylint#8802
777
778 * Infer user-defined enum classes by checking if the class is a subtype of ``enum.Enum``.
779
780 Closes pylint-dev/pylint#8897
781
782 * Fix inference of functions with ``@functools.lru_cache`` decorators without
783 parentheses.
784
785 Closes pylint-dev/pylint#8868
786
787 * Make ``sys.argv`` uninferable because it never is. (It's impossible to infer
788 the value it will have outside of static analysis where it's our own value.)
789
790 Refs pylint-dev/pylint#7710
791
792
793 What's New in astroid 2.15.6?
794 =============================
795 Release date: 2023-07-08
796
797 * Harden ``get_module_part()`` against ``"."``.
798
799 Closes pylint-dev/pylint#8749
800
801 * Allow ``AsStringVisitor`` to visit ``objects.PartialFunction``.
802
803 Closes pylint-dev/pylint#8881
804
805 * Avoid expensive list/tuple multiplication operations that would result in ``MemoryError``.
806
807 Closes pylint-dev/pylint#8748
808
809 * Fix a regression in 2.12.0 where settings in AstroidManager would be ignored.
810 Most notably this addresses pylint-dev/pylint#7433.
811
812 Refs #2204
813
814
815 What's New in astroid 2.15.5?
816 =============================
817 Release date: 2023-05-14
818
819 * Handle ``objects.Super`` in ``helpers.object_type()``.
820
821 Refs pylint-dev/pylint#8554
822
823 * Recognize stub ``pyi`` Python files.
824
825 Refs pylint-dev/pylint#4987
826
827
828 What's New in astroid 2.15.4?
829 =============================
830 Release date: 2023-04-24
831
832 * Add visitor function for ``TryStar`` to ``AsStringVisitor`` and
833 add ``TryStar`` to ``astroid.nodes.ALL_NODE_CLASSES``.
834
835 Refs #2142
836
837
838 What's New in astroid 2.15.3?
839 =============================
840 Release date: 2023-04-16
841
842 * Fix ``infer_call_result()`` crash on methods called ``with_metaclass()``.
843
844 Closes #1735
845
846 * Suppress ``UserWarning`` when finding module specs.
847
848 Closes pylint-dev/pylint#7906
849
850
851 What's New in astroid 2.15.2?
852 =============================
853 Release date: 2023-04-03
854
855 * Support more possible usages of ``attrs`` decorators.
856
857 Closes pylint-dev/pylint#7884
858
859
860 What's New in astroid 2.15.1?
861 =============================
862 Release date: 2023-03-26
863
864 * Restore behavior of setting a Call as a base for classes created using ``six.with_metaclass()``,
865 and harden support for using enums as metaclasses in this case.
866
867 Reverts #1622
868 Refs pylint-dev/pylint#5935
869 Refs pylint-dev/pylint#7506
870
871
872 What's New in astroid 2.15.0?
873 =============================
874 Release date: 2023-03-06
875
876 * astroid now supports ``TryStar`` nodes from python 3.11 and should be fully compatible with python 3.11.
877
878 Closes #2028
879
880 * ``Formattedvalue.postinit`` is now keyword only. This is to allow correct typing of the
881 ``Formattedvalue`` class.
882
883 Refs #1516
884
885 * ``Astroid`` now supports custom import hooks.
886
887 Refs pylint-dev/pylint#7306
888
889 * ``astroid`` now infers return values from match cases.
890
891 Refs pylint-dev/pylint#5288
892
893 * ``AstroidManager.clear_cache`` now also clears the inference context cache.
894
895 Refs #1780
896
897 * ``max_inferable_values`` can now be set on ``AstroidManager`` instances, e.g. ``astroid.MANAGER``
898 besides just the ``AstroidManager`` class itself.
899
900 Closes #2280
901
902 * ``Astroid`` now retrieves the default values of keyword only arguments and sets them on
903 ``Arguments.kw_defaults``.
904
905 * ``Uninferable`` now has the type ``UninferableBase``. This is to facilitate correctly type annotating
906 code that uses this singleton.
907
908 Closes #1680
909
910 * Deprecate ``modutils.is_standard_module()``. It will be removed in the next minor release.
911 Functionality has been replaced by two new functions,
912 ``modutils.is_stdlib_module()`` and ``modutils.module_in_path()``.
913
914 Closes #2012
915
916
917 * Fix ``are_exclusive`` function when a walrus operator is used inside ``IfExp.test`` field.
918
919 Closes #2022
920
921 What's New in astroid 2.14.2?
922 =============================
923 Release date: 2023-02-12
924
925 * '_infer_str_format_call' won't crash anymore when the string it analyses are uninferable.
926
927 Closes pylint-dev/pylint#8109
928
929
930 What's New in astroid 2.14.1?
931 =============================
932 Release date: 2023-01-31
933
934 * Revert ``CallContext`` change as it caused a ``RecursionError`` regression.
935
936
937 What's New in astroid 2.14.0?
938 =============================
939 Release date: 2023-01-31
940
941 * Add support for inferring binary union types added in Python 3.10.
942
943 Refs pylint-dev/pylint#8119
944
945 * Capture and log messages emitted when inspecting a module for astroid.
946
947 Closes #1904
948
949
950 What's New in astroid 2.13.5?
951 =============================
952 Release date: 2023-01-31
953
954 * Revert ``CallContext`` change as it caused a ``RecursionError`` regression.
955
956
957 What's New in astroid 2.13.4?
958 =============================
959 Release date: 2023-01-31
960
961 * Fix issues with ``typing_extensions.TypeVar``.
962
963 * Fix ``ClassDef.fromlino`` for PyPy 3.8 (v7.3.11) if class is wrapped by a decorator.
964
965 * Preserve parent CallContext when inferring nested functions.
966
967 Closes pylint-dev/pylint#8074
968
969 * Add ``Lock`` to the ``multiprocessing`` brain.
970
971 Closes pylint-dev/pylint#3313
972
973
974 What's New in astroid 2.13.3?
975 =============================
976 Release date: 2023-01-20
977
978 * Fix a regression in 2.13.2 where a RunTimeError could be raised unexpectedly.
979
980 Closes #1958
981
982 * Fix overwritten attributes in inherited dataclasses not being ordered correctly.
983
984 Closes pylint-dev/pylint#7881
985
986 * Fix a false positive when an attribute named ``Enum`` was confused with ``enum.Enum``.
987 Calls to ``Enum`` are now inferred & the qualified name is checked.
988
989 Refs pylint-dev/pylint#5719
990
991 * Remove unnecessary typing_extensions dependency on Python 3.11 and newer
992
993 What's New in astroid 2.13.2?
994 =============================
995 Release date: 2023-01-08
996
997 * Removed version conditions on typing_extensions dependency. Removed typing_extensions from
998 our tests requirements as it was preventing issues to appear in our continuous integration.
999
1000 Closes #1945
1001
1002
1003 What's New in astroid 2.13.1?
1004 =============================
1005 Release date: 2023-01-08
1006
1007 * Bumping typing_extensions to 4.0.0 that is required when using ``Self``
1008
1009 Closes #1942
1010
1011 What's New in astroid 2.13.0?
1012 =============================
1013 Release date: 2023-01-07
1014
1015 * Fixed importing of modules that have the same name as the file that is importing.
1016 ``astroid`` will now correctly handle an ``import math`` statement in a file called ``math.py``
1017 by relying on the import system.
1018
1019 Refs pylint-dev/pylint#5151
1020
1021 * Create ``ContextManagerModel`` and let ``GeneratorModel`` inherit from it.
1022
1023 Refs pylint-dev/pylint#2567
1024
1025 * Added a ``regex`` brain.
1026
1027 Refs pylint-dev/pylint#1911
1028
1029 * Support "is None" constraints from if statements during inference.
1030
1031 Ref #791
1032 Ref pylint-dev/pylint#157
1033 Ref pylint-dev/pylint#1472
1034 Ref pylint-dev/pylint#2016
1035 Ref pylint-dev/pylint#2631
1036 Ref pylint-dev/pylint#2880
1037
1038 What's New in astroid 2.12.14?
1039 ==============================
1040 Release date: 2023-01-06
1041
1042 * Handle the effect of properties on the ``__init__`` of a dataclass correctly.
1043
1044 Closes pylint-dev/pylint#5225
1045
1046 * Handle the effect of ``kw_only=True`` in dataclass fields correctly.
1047
1048 Closes pylint-dev/pylint#7623
1049
1050 * Handle the effect of ``init=False`` in dataclass fields correctly.
1051
1052 Closes pylint-dev/pylint#7291
1053
1054 * Fix crash if ``numpy`` module doesn't have ``version`` attribute.
1055
1056 Refs pylint-dev/pylint#7868
1057
1058 * Handle ``AttributeError`` during ``str.format`` template inference tip evaluation
1059
1060 Closes pylint-dev/pylint#1902
1061
1062 * Add the ``masked_invalid`` function in the ``numpy.ma`` brain.
1063
1064 Closes pylint-dev/pylint#5715
1065
1066 What's New in astroid 2.12.13?
1067 ==============================
1068 Release date: 2022-11-19
1069
1070 * Prevent returning an empty list for ``ClassDef.slots()`` when the mro list contains one class & it is not ``object``.
1071
1072 Refs pylint-dev/pylint#5099
1073
1074 * Prevent a crash when inferring calls to ``str.format`` with inferred arguments
1075 that would be invalid.
1076
1077 Closes #1856
1078
1079 * Infer the `length` argument of the ``random.sample`` function.
1080
1081 Refs pylint-dev/pylint#7706
1082
1083 * Catch ``ValueError`` when indexing some builtin containers and sequences during inference.
1084
1085 Closes #1843
1086
1087 What's New in astroid 2.12.12?
1088 ==============================
1089 Release date: 2022-10-19
1090
1091 * Add the ``length`` parameter to ``hash.digest`` & ``hash.hexdigest`` in the ``hashlib`` brain.
1092
1093 Refs pylint-dev/pylint#4039
1094
1095 * Prevent a crash when a module's ``__path__`` attribute is unexpectedly missing.
1096
1097 Refs pylint-dev/pylint#7592
1098
1099 * Fix inferring attributes with empty annotation assignments if parent
1100 class contains valid assignment.
1101
1102 Refs pylint-dev/pylint#7631
1103
1104
1105 What's New in astroid 2.12.11?
1106 ==============================
1107 Release date: 2022-10-10
1108
1109 * Add ``_value2member_map_`` member to the ``enum`` brain.
1110
1111 Refs pylint-dev/pylint#3941
1112
1113 * Improve detection of namespace packages for the modules with ``__spec__`` set to None.
1114
1115 Closes pylint-dev/pylint#7488.
1116
1117 * Fixed a regression in the creation of the ``__init__`` of dataclasses with
1118 multiple inheritance.
1119
1120 Closes pylint-dev/pylint#7434
1121
1122
1123 What's New in astroid 2.12.10?
1124 ==============================
1125 Release date: 2022-09-17
1126
1127
1128 * Fixed a crash when introspecting modules compiled by `cffi`.
1129
1130 Closes #1776
1131 Closes pylint-dev/pylint#7399
1132
1133 * ``decorators.cached`` now gets its cache cleared by calling ``AstroidManager.clear_cache``.
1134
1135 Refs #1780
1136
1137 What's New in astroid 2.12.9?
1138 =============================
1139 Release date: 2022-09-07
1140
1141 * Fixed creation of the ``__init__`` of ``dataclassess`` with multiple inheritance.
1142
1143 Closes pylint-dev/pylint#7427
1144
1145 * Fixed a crash on ``namedtuples`` that use ``typename`` to specify their name.
1146
1147 Closes pylint-dev/pylint#7429
1148
1149
1150
1151 What's New in astroid 2.12.8?
1152 =============================
1153 Release date: 2022-09-06
1154
1155 * Fixed a crash in the ``dataclass`` brain for ``InitVars`` without subscript typing.
1156
1157 Closes pylint-dev/pylint#7422
1158
1159 * Fixed parsing of default values in ``dataclass`` attributes.
1160
1161 Closes pylint-dev/pylint#7425
1162
1163 What's New in astroid 2.12.7?
1164 =============================
1165 Release date: 2022-09-06
1166
1167 * Fixed a crash in the ``dataclass`` brain for uninferable bases.
1168
1169 Closes pylint-dev/pylint#7418
1170
1171
1172 What's New in astroid 2.12.6?
1173 =============================
1174 Release date: 2022-09-05
1175
1176 * Fix a crash involving ``Uninferable`` arguments to ``namedtuple()``.
1177
1178 Closes pylint-dev/pylint#7375
1179
1180 * The ``dataclass`` brain now understands the ``kw_only`` keyword in dataclass decorators.
1181
1182 Closes pylint-dev/pylint#7290
1183
1184
1185 What's New in astroid 2.12.5?
1186 =============================
1187 Release date: 2022-08-29
1188
1189 * Prevent first-party imports from being resolved to `site-packages`.
1190
1191 Refs pylint-dev/pylint#7365
1192
1193 * Fix ``astroid.interpreter._import.util.is_namespace()`` incorrectly
1194 returning ``True`` for frozen stdlib modules on PyPy.
1195
1196 Closes #1755
1197
1198
1199 What's New in astroid 2.12.4?
1200 =============================
1201 Release date: 2022-08-25
1202
1203 * Fixed a crash involving non-standard type comments such as ``# type: # any comment``.
1204
1205 Refs pylint-dev/pylint#7347
1206
1207
1208 What's New in astroid 2.12.3?
1209 =============================
1210 Release date: 2022-08-23
1211
1212 * Fixed crash in ``ExplicitNamespacePackageFinder`` involving ``_SixMetaPathImporter``.
1213
1214 Closes #1708
1215
1216 * Fix unhandled `FutureWarning` from pandas import in cython modules
1217
1218 Closes #1717
1219
1220 * Fix false positive with inference of type-annotated Enum classes.
1221
1222 Refs pylint-dev/pylint#7265
1223
1224 * Fix crash with inference of type-annotated Enum classes where the member has no value.
1225
1226 * Fix a crash inferring invalid old-style string formatting with `%`.
1227
1228 Closes #1737
1229
1230 * Fix false positive with inference of ``http`` module when iterating ``HTTPStatus``.
1231
1232 Refs pylint-dev/pylint#7307
1233
1234 * Bumped minimum requirement of ``wrapt`` to 1.14 on Python 3.11.
1235
1236
1237 * Don't add dataclass fields annotated with ``KW_ONLY`` to the list of fields.
1238
1239 Refs pylint-dev/pylint#5767
1240
1241 What's New in astroid 2.12.2?
1242 =============================
1243 Release date: 2022-07-12
1244
1245 * Fixed crash in modulo operations for divisions by zero.
1246
1247 Closes #1700
1248
1249 * Fixed crash with recursion limits during inference.
1250
1251 Closes #1646
1252
1253 What's New in astroid 2.12.1?
1254 =============================
1255 Release date: 2022-07-10
1256
1257 * Fix a crash when inferring old-style string formatting (``%``) using tuples.
1258
1259 * Fix a crash when ``None`` (or a value inferred as ``None``) participates in a
1260 ``**`` expression.
1261
1262 * Fix a crash involving properties within ``if`` blocks.
1263
1264
1265 What's New in astroid 2.12.0?
1266 =============================
1267 Release date: 2022-07-09
1268
1269 * Fix signal has no ``connect`` member for PySide2 5.15.2+ and PySide6
1270
1271 Closes #4040, #5378
1272
1273 * ``astroid`` now requires Python 3.7.2 to run.
1274
1275 * Avoid setting a Call as a base for classes created using ``six.with_metaclass()``.
1276
1277 Refs pylint-dev/pylint#5935
1278
1279 * Fix detection of builtins on ``PyPy`` 3.9.
1280
1281 * Fix ``re`` brain on Python ``3.11``. The flags now come from ``re._compile``.
1282
1283 * Build ``nodes.Module`` for frozen modules which have location information in their
1284 ``ModuleSpec``.
1285
1286 Closes #1512
1287
1288 * The ``astroid.mixins`` module has been deprecated and marked for removal in 3.0.0.
1289
1290 Closes #1633
1291
1292 * Capture and log messages emitted by C extensions when importing them.
1293 This prevents contaminating programmatic output, e.g. pylint's JSON reporter.
1294
1295 Closes pylint-dev/pylint#3518
1296
1297 * Calls to ``str.format`` are now correctly inferred.
1298
1299 Closes #104, Closes #1611
1300
1301 * ``__new__`` and ``__init__`` have been added to the ``ObjectModel`` and are now
1302 inferred as ``BoundMethods``.
1303
1304 * Old style string formatting (using ``%`` operators) is now correctly inferred.
1305
1306 Closes #151
1307
1308 * Adds missing enums from ``ssl`` module.
1309
1310 Closes pylint-dev/pylint#3691
1311
1312 * Remove dependency on ``pkg_resources`` from ``setuptools``.
1313
1314 Closes #1103
1315
1316 * Allowed ``AstroidManager.clear_cache`` to reload necessary brain plugins.
1317
1318 * Fixed incorrect inferences after rebuilding the builtins module, e.g. by calling
1319 ``AstroidManager.clear_cache``.
1320
1321 Closes #1559
1322
1323 * ``Arguments.defaults`` is now ``None`` for uninferable signatures.
1324
1325 * On Python versions >= 3.9, ``astroid`` now understands subscripting
1326 builtin classes such as ``enumerate`` or ``staticmethod``.
1327
1328 * Fixed inference of ``Enums`` when they are imported under an alias.
1329
1330 Closes pylint-dev/pylint#5776
1331
1332 * Rename ``ModuleSpec`` -> ``module_type`` constructor parameter to match attribute
1333 name and improve typing. Use ``type`` instead.
1334
1335 * ``ObjectModel`` and ``ClassModel`` now know about their ``__new__`` and ``__call__`` attributes.
1336
1337 * Fixed pylint ``not-callable`` false positive with nested-tuple assignment in a for-loop.
1338
1339 Refs pylint-dev/pylint#5113
1340
1341 * Instances of builtins created with ``__new__(cls, value)`` are now inferred.
1342
1343 * Infer the return value of the ``.copy()`` method on ``dict``, ``list``, ``set``,
1344 and ``frozenset``.
1345
1346 Closes #1403
1347
1348 * Fixed inference of elements of living container objects such as tuples and sets in the
1349 ``sys`` and ``ssl`` modules.
1350
1351 * Add ``pathlib`` brain to handle ``pathlib.PurePath.parents`` inference.
1352
1353 Closes pylint-dev/pylint#5783
1354
1355 * Avoid inferring the results of ``**`` operations involving values greater than ``1e5``
1356 to avoid expensive computation.
1357
1358 Closes pylint-dev/pylint#6745
1359
1360 * Fix test for Python ``3.11``. In some instances ``err.__traceback__`` will
1361 be uninferable now.
1362
1363 * Add brain for numpy core module ``einsumfunc``.
1364
1365 Closes pylint-dev/pylint#5821
1366
1367 * Infer the ``DictUnpack`` value for ``Dict.getitem`` calls.
1368
1369 Closes #1195
1370
1371 * Fix a crash involving properties within ``try ... except`` blocks.
1372
1373 Closes pylint-dev/pylint#6592
1374
1375 * Prevent creating ``Instance`` objects that proxy other ``Instance``s when there is
1376 ambiguity (or user error) in calling ``__new__(cls)``.
1377
1378 Refs pylint-dev/pylint#7109
1379
1380 What's New in astroid 2.11.7?
1381 =============================
1382 Release date: 2022-07-09
1383
1384 * Added support for ``usedforsecurity`` keyword to ``hashlib`` constructors.
1385
1386 Closes pylint-dev/pylint#6017
1387
1388 * Updated the stdlib brain for ``subprocess.Popen`` to accommodate Python 3.9+.
1389
1390 Closes pylint-dev/pylint#7092
1391
1392 What's New in astroid 2.11.6?
1393 =============================
1394 Release date: 2022-06-13
1395
1396 * The Qt brain now correctly treats calling ``.disconnect()`` (with no
1397 arguments) on a slot as valid.
1398
1399 * The argparse brain no longer incorrectly adds ``"Namespace"`` to the locals
1400 of functions that return an ``argparse.Namespace`` object.
1401
1402 Refs pylint-dev/pylint#6895
1403
1404 What's New in astroid 2.11.5?
1405 =============================
1406 Release date: 2022-05-09
1407
1408 * Fix crash while obtaining ``object_type()`` of an ``Unknown`` node.
1409
1410 Refs pylint-dev/pylint#6539
1411
1412 * Fix a bug where in attempting to handle the patching of ``distutils`` by ``virtualenv``,
1413 library submodules called ``distutils`` (e.g. ``numpy.distutils``) were included also.
1414
1415 Refs pylint-dev/pylint#6497
1416
1417 What's New in astroid 2.11.4?
1418 =============================
1419 Release date: 2022-05-02
1420
1421 * Fix ``col_offset`` attribute for nodes involving ``with`` on ``PyPy``.
1422
1423 * Fixed a crash involving two starred expressions: one inside a comprehension,
1424 both inside a call.
1425
1426 Refs pylint-dev/pylint#6372
1427
1428 * Made ``FunctionDef.implicit_parameters`` return 1 for methods by making
1429 ``FunctionDef.is_bound`` return ``True``, as it does for class methods.
1430
1431 Closes pylint-dev/pylint#6464
1432
1433 * Fixed a crash when ``_filter_stmts`` encounters an ``EmptyNode``.
1434
1435 Closes pylint-dev/pylint#6438
1436
1437
1438 What's New in astroid 2.11.3?
1439 =============================
1440 Release date: 2022-04-19
1441
1442 * Fixed an error in the Qt brain when building ``instance_attrs``.
1443
1444 Closes pylint-dev/pylint#6221
1445
1446 * Fixed a crash in the ``gi`` brain.
1447
1448 Closes pylint-dev/pylint#6371
1449
1450
1451 What's New in astroid 2.11.2?
1452 =============================
1453 Release date: 2022-03-26
1454
1455 * Avoided adding the name of a parent namedtuple to its child's locals.
1456
1457 Refs pylint-dev/pylint#5982
1458
1459
1460 What's New in astroid 2.11.1?
1461 =============================
1462 Release date: 2022-03-22
1463
1464 * Promoted ``getattr()`` from ``astroid.scoped_nodes.FunctionDef`` to its parent
1465 ``astroid.scoped_nodes.Lambda``.
1466
1467 * Fixed crash on direct inference via ``nodes.FunctionDef._infer``.
1468
1469 Closes #817
1470
1471
1472 What's New in astroid 2.11.0?
1473 =============================
1474 Release date: 2022-03-12
1475
1476 * Add new (optional) ``doc_node`` attribute to ``nodes.Module``, ``nodes.ClassDef``,
1477 and ``nodes.FunctionDef``.
1478
1479 * Accessing the ``doc`` attribute of ``nodes.Module``, ``nodes.ClassDef``, and
1480 ``nodes.FunctionDef`` has been deprecated in favour of the ``doc_node`` attribute.
1481 Note: ``doc_node`` is an (optional) ``nodes.Const`` whereas ``doc`` was an (optional) ``str``.
1482
1483 * Passing the ``doc`` argument to the ``__init__`` of ``nodes.Module``, ``nodes.ClassDef``,
1484 and ``nodes.FunctionDef`` has been deprecated in favour of the ``postinit`` ``doc_node`` attribute.
1485 Note: ``doc_node`` is an (optional) ``nodes.Const`` whereas ``doc`` was an (optional) ``str``.
1486
1487 * Replace custom ``cachedproperty`` with ``functools.cached_property`` and deprecate it
1488 for Python 3.8+.
1489
1490 Closes #1410
1491
1492 * Set ``end_lineno`` and ``end_col_offset`` attributes to ``None`` for all nodes
1493 with PyPy 3.8. PyPy 3.8 assigns these attributes inconsistently which could lead
1494 to unexpected errors. Overwriting them with ``None`` will cause a fallback
1495 to the already supported way of PyPy 3.7.
1496
1497 * Add missing ``shape`` parameter to numpy ``zeros_like``, ``ones_like``,
1498 and ``full_like`` methods.
1499
1500 Closes pylint-dev/pylint#5871
1501
1502 * Only pin ``wrapt`` on the major version.
1503
1504
1505 What's New in astroid 2.10.0?
1506 =============================
1507 Release date: 2022-02-27
1508
1509
1510 * Fixed inference of ``self`` in binary operations in which ``self``
1511 is part of a list or tuple.
1512
1513 Closes pylint-dev/pylint#4826
1514
1515 * Fixed builtin inference on `property` calls not calling the `postinit` of the new node, which
1516 resulted in instance arguments missing on these nodes.
1517
1518 * Fixed a crash on ``Super.getattr`` when the attribute was previously uninferable due to a cache
1519 limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the
1520 ``__init__`` attribute) is very large.
1521
1522 Closes pylint-dev/pylint#5679
1523
1524 * Include names of keyword-only arguments in ``astroid.scoped_nodes.Lambda.argnames``.
1525
1526 Closes pylint-dev/pylint#5771
1527
1528 * Fixed a crash inferring on a ``NewType`` named with an f-string.
1529
1530 Closes pylint-dev/pylint#5770
1531
1532 * Add support for [attrs v21.3.0](https://github.com/python-attrs/attrs/releases/tag/21.3.0) which
1533 added a new `attrs` module alongside the existing `attr`.
1534
1535 Closes #1330
1536
1537 * Use the ``end_lineno`` attribute for the ``NodeNG.tolineno`` property
1538 when it is available.
1539
1540 Closes #1350
1541
1542 * Add ``is_dataclass`` attribute to ``ClassDef`` nodes.
1543
1544 * Use ``sysconfig`` instead of ``distutils`` to determine the location of
1545 python stdlib files and packages.
1546
1547 Related pull requests: #1322, #1323, #1324
1548 Closes #1282
1549 Ref #1103
1550
1551 * Fixed crash with recursion error for inference of class attributes that referenced
1552 the class itself.
1553
1554 Closes pylint-dev/pylint#5408
1555
1556 * Fixed crash when trying to infer ``items()`` on the ``__dict__``
1557 attribute of an imported module.
1558
1559 Closes #1085
1560
1561 * Add optional ``NodeNG.position`` attribute.
1562 Used for block nodes to highlight position of keyword(s) and name
1563 in cases where the AST doesn't provide good enough positional information.
1564 E.g. ``nodes.ClassDef``, ``nodes.FunctionDef``.
1565
1566 * Fix ``ClassDef.fromlineno``. For Python < 3.8 the ``lineno`` attribute includes decorators.
1567 ``fromlineno`` should return the line of the ``class`` statement itself.
1568
1569 * Performance improvements. Only run expensive decorator functions when
1570 non-default Deprecation warnings are enabled, eg. during a Pytest run.
1571
1572 Closes #1383
1573
1574
1575 What's New in astroid 2.9.3?
1576 ============================
1577 Release date: 2022-01-09
1578
1579 * Fixed regression where packages without a ``__init__.py`` file were
1580 not recognized or imported correctly.
1581
1582 Closes #1327
1583
1584 What's New in astroid 2.9.2?
1585 ============================
1586 Release date: 2022-01-04
1587
1588 * Fixed regression in ``astroid.scoped_nodes`` where ``_is_metaclass``
1589 was not accessible anymore.
1590
1591 Closes #1325
1592
1593 What's New in astroid 2.9.1?
1594 ============================
1595 Release date: 2021-12-31
1596
1597 * ``NodeNG.frame()`` and ``NodeNG.statement()`` will start raising ``ParentMissingError``
1598 instead of ``AttributeError`` in astroid 3.0. This behaviour can already be triggered
1599 by passing ``future=True`` to a ``frame()`` or ``statement()`` call.
1600
1601 * Prefer the module loader get_source() method in AstroidBuilder's
1602 module_build() when possible to avoid assumptions about source
1603 code being available on a filesystem. Otherwise the source cannot
1604 be found and application behavior changes when running within an
1605 embedded hermetic interpreter environment (pyoxidizer, etc.).
1606
1607 * Require Python 3.6.2 to use astroid.
1608
1609 * Removed custom ``distutils`` handling for resolving paths to submodules.
1610
1611 Ref #1321
1612
1613 * Restore custom ``distutils`` handling for resolving paths to submodules.
1614
1615 Closes pylint-dev/pylint#5645
1616
1617 * Fix ``deque.insert()`` signature in ``collections`` brain.
1618
1619 Closes #1260
1620
1621 * Fix ``Module`` nodes not having a ``col_offset``, ``end_lineno``, and ``end_col_offset``
1622 attributes.
1623
1624 * Fix typing and update explanation for ``Arguments.args`` being ``None``.
1625
1626 * Fix crash if a variable named ``type`` is accessed with an index operator (``[]``)
1627 in a generator expression.
1628
1629 Closes pylint-dev/pylint#5461
1630
1631 * Enable inference of dataclass import from marshmallow_dataclass.
1632 This allows the dataclasses brain to recognize dataclasses annotated by marshmallow_dataclass.
1633
1634 * Resolve symlinks in the import path
1635 Fixes inference error when the import path includes symlinks (e.g. Python
1636 installed on macOS via Homebrew).
1637
1638 Closes #823
1639 Closes pylint-dev/pylint#3499
1640 Closes pylint-dev/pylint#4302
1641 Closes pylint-dev/pylint#4798
1642 Closes pylint-dev/pylint#5081
1643
1644 What's New in astroid 2.9.0?
1645 ============================
1646 Release date: 2021-11-21
1647
1648 * Add ``end_lineno`` and ``end_col_offset`` attributes to astroid nodes.
1649
1650 * Always treat ``__class_getitem__`` as a classmethod.
1651
1652 * Add missing ``as_string`` visitor method for ``Unknown`` node.
1653
1654 Closes #1264
1655
1656
1657 What's New in astroid 2.8.6?
1658 ============================
1659 Release date: 2021-11-21
1660
1661 * Fix crash on inference of subclasses created from ``Class().__subclasses__``
1662
1663 Closes pylint-dev/pylint#4982
1664
1665 * Fix bug with Python 3.7.0 / 3.7.1 and ``typing.NoReturn``.
1666
1667 Closes #1239
1668
1669
1670 What's New in astroid 2.8.5?
1671 ============================
1672 Release date: 2021-11-12
1673
1674 * Use more permissive versions for the ``typed-ast`` dependency (<2.0 instead of <1.5)
1675
1676 Closes #1237
1677
1678 * Fix crash on inference of ``__len__``.
1679
1680 Closes pylint-dev/pylint#5244
1681
1682 * Added missing ``kind`` (for ``Const``) and ``conversion`` (for ``FormattedValue``) fields to repr.
1683
1684 * Fix crash with assignment expressions, nested if expressions and filtering of statements
1685
1686 Closes pylint-dev/pylint#5178
1687
1688 * Fix incorrect filtering of assignment expressions statements
1689
1690
1691 What's New in astroid 2.8.4?
1692 ============================
1693 Release date: 2021-10-25
1694
1695 * Fix the ``scope()`` and ``frame()`` methods of ``NamedExpr`` nodes.
1696 When these nodes occur in ``Arguments``, ``Keyword`` or ``Comprehension`` nodes these
1697 methods now correctly point to the outer-scope of the ``FunctionDef``,
1698 ``ClassDef``, or ``Comprehension``.
1699
1700 * Fix the ``set_local`` function for ``NamedExpr`` nodes.
1701 When these nodes occur in ``Arguments``, ``Keyword``, or ``Comprehension`` nodes these
1702 nodes are now correctly added to the locals of the ``FunctionDef``,
1703 ``ClassDef``, or ``Comprehension``.
1704
1705
1706 What's New in astroid 2.8.3?
1707 ============================
1708 Release date: 2021-10-17
1709
1710 * Add support for wrapt 1.13
1711
1712 * Fixes handling of nested partial functions
1713
1714 Closes pylint-dev/pylint#2462
1715 Closes #1208
1716
1717 * Fix regression with the import resolver
1718
1719 Closes pylint-dev/pylint#5131
1720
1721 * Fix crash with invalid dataclass field call
1722
1723 Closes pylint-dev/pylint#5153
1724
1725
1726 What's New in astroid 2.8.2?
1727 ============================
1728 Release date: 2021-10-07
1729
1730 Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a
1731 mistake when creating the tag.
1732
1733
1734 What's New in astroid 2.8.1?
1735 ============================
1736 Release date: 2021-10-06
1737
1738 * Adds support of type hints inside numpy's brains.
1739
1740 Closes pylint-dev/pylint#4326
1741
1742 * Enable inference of dataclass import from pydantic.dataclasses.
1743 This allows the dataclasses brain to recognize pydantic dataclasses.
1744
1745 Closes pylint-dev/pylint#4899
1746
1747 * Fix regression on ClassDef inference
1748
1749 Closes pylint-dev/pylint#5030
1750 Closes pylint-dev/pylint#5036
1751
1752 * Fix regression on Compare node inference
1753
1754 Closes pylint-dev/pylint#5048
1755
1756 * Extended attrs brain to support the provisional APIs
1757
1758 * Astroid does not trigger it's own deprecation warning anymore.
1759
1760 * Improve brain for ``typing.Callable`` and ``typing.Type``.
1761
1762 * Fix bug with importing namespace packages with relative imports
1763
1764 Closes pylint-dev/pylint#5059
1765
1766 * The ``is_typing_guard`` and ``is_sys_guard`` functions are deprecated and will
1767 be removed in 3.0.0. They are complex meta-inference functions that are better
1768 suited for pylint. Import them from ``pylint.checkers.utils`` instead
1769 (requires pylint ``2.12``).
1770
1771 * Suppress the conditional between applied brains and dynamic import authorized
1772 modules. (Revert the "The transforms related to a module are applied only if this
1773 module has not been explicitly authorized to be imported" of version 2.7.3)
1774
1775 * Adds a brain to infer the ``numpy.ma.masked_where`` function.
1776
1777 Closes pylint-dev/pylint#3342
1778
1779
1780 What's New in astroid 2.8.0?
1781 ============================
1782 Release date: 2021-09-14
1783
1784 * Add additional deprecation warnings in preparation for astroid 3.0
1785
1786 * Require attributes for some node classes with ``__init__`` call.
1787
1788 * ``name`` (``str``) for ``Name``, ``AssignName``, ``DelName``
1789 * ``attrname`` (``str``) for ``Attribute``, ``AssignAttr``, ``DelAttr``
1790 * ``op`` (``str``) for ``AugAssign``, ``BinOp``, ``BoolOp``, ``UnaryOp``
1791 * ``names`` (``list[tuple[str, str | None]]``) for ``Import``
1792
1793 * Support pyz imports
1794
1795 Closes pylint-dev/pylint#3887
1796
1797 * Add ``node_ancestors`` method to ``NodeNG`` for obtaining the ancestors of nodes.
1798
1799 * It's now possible to infer the value of comparison nodes
1800
1801 Closes #846
1802
1803 * Fixed bug in inference of dataclass field calls.
1804
1805 Closes pylint-dev/pylint#4963
1806
1807
1808 What's New in astroid 2.7.3?
1809 ============================
1810 Release date: 2021-08-30
1811
1812 * The transforms related to a module are applied only if this module has not been explicitly authorized to be imported
1813 (i.e is not in AstroidManager.extension_package_whitelist). Solves the following issues if numpy is authorized to be imported
1814 through the `extension-pkg-allow-list` option.
1815
1816 Closes pylint-dev/pylint#3342
1817 Closes pylint-dev/pylint#4326
1818
1819 * Fixed bug in attribute inference from inside method calls.
1820
1821 Closes pylint-dev/pylint#400
1822
1823 * Fixed bug in inference for superclass instance methods called
1824 from the class rather than an instance.
1825
1826 Closes #1008
1827 Closes pylint-dev/pylint#4377
1828
1829 * Fixed bug in inference of chained attributes where a subclass
1830 had an attribute that was an instance of its superclass.
1831
1832 Closes pylint-dev/pylint#4220
1833
1834 * Adds a brain for the ctypes module.
1835
1836 Closes pylint-dev/pylint#4896
1837
1838 * When processing dataclass attributes, exclude the same type hints from abc.collections
1839 as from typing.
1840
1841 Closes pylint-dev/pylint#4895
1842
1843 * Apply dataclass inference to pydantic's dataclasses.
1844
1845 Closes pylint-dev/pylint#4899
1846
1847
1848 What's New in astroid 2.7.2?
1849 ============================
1850 Release date: 2021-08-20
1851
1852 * ``BaseContainer`` is now public, and will replace ``_BaseContainer`` completely in astroid 3.0.
1853 * The call cache used by inference functions produced by ``inference_tip``
1854 can now be cleared via ``clear_inference_tip_cache``.
1855
1856 * ``astroid.const.BUILTINS`` and ``astroid.bases.BUILTINS`` are not used internally anymore
1857 and will be removed in astroid 3.0. Simply replace this by the string 'builtins' for better
1858 performances and clarity.
1859
1860 * Add inference for dataclass initializer method.
1861
1862 Closes pylint-dev/pylint#3201
1863
1864 What's New in astroid 2.7.1?
1865 ============================
1866 Release date: 2021-08-16
1867
1868 * When processing dataclass attributes, only do typing inference on collection types.
1869 Support for instantiating other typing types is left for the future, if desired.
1870
1871 Closes #1129
1872
1873 * Fixed LookupMixIn missing from ``astroid.node_classes``.
1874
1875
1876 What's New in astroid 2.7.0?
1877 ============================
1878 Release date: 2021-08-15
1879
1880 * Import from ``astroid.node_classes`` and ``astroid.scoped_nodes`` has been deprecated in favor of
1881 ``astroid.nodes``. Only the imports from ``astroid.nodes`` will work in astroid 3.0.0.
1882
1883 * Add support for arbitrary Enum subclass hierarchies
1884
1885 Closes pylint-dev/pylint#533
1886 Closes pylint-dev/pylint#2224
1887 Closes pylint-dev/pylint#2626
1888
1889 * Add inference tips for dataclass attributes, including dataclasses.field calls.
1890 Also add support for InitVar.
1891
1892 Closes pylint-dev/pylint#2600
1893 Closes pylint-dev/pylint#2698
1894 Closes pylint-dev/pylint#3405
1895 Closes pylint-dev/pylint#3794
1896
1897 * Adds a brain that deals with dynamic import of `IsolatedAsyncioTestCase` class of the `unittest` module.
1898
1899 Closes pylint-dev/pylint#4060
1900
1901
1902 What's New in astroid 2.6.6?
1903 ============================
1904 Release date: 2021-08-03
1905
1906 * Added support to infer return type of ``typing.cast()``
1907
1908 * Fix variable lookup handling of exclusive statements
1909
1910 Closes pylint-dev/pylint#3711
1911
1912 * Fix variable lookup handling of function parameters
1913
1914 Closes pylint-dev/astroid#180
1915
1916 * Fix variable lookup's handling of except clause variables
1917
1918 * Fix handling of classes with duplicated bases with the same name
1919
1920 Closes pylint-dev/astroid#1088
1921
1922 What's New in astroid 2.6.5?
1923 ============================
1924 Release date: 2021-07-21
1925
1926 * Fix a crash when there would be a 'TypeError object does not support
1927 item assignment' in the code we parse.
1928
1929 Closes pylint-dev/pylint#4439
1930
1931 * Fix a crash when a AttributeInferenceError was raised when
1932 failing to find the real name in infer_import_from.
1933
1934 Closes pylint-dev/pylint#4692
1935
1936
1937 What's New in astroid 2.6.4?
1938 ============================
1939 Release date: 2021-07-19
1940
1941 * Fix a crash when a StopIteration was raised when inferring
1942 a faulty function in a context manager.
1943
1944 Closes pylint-dev/pylint#4723
1945
1946 What's New in astroid 2.6.3?
1947 ============================
1948 Release date: 2021-07-19
1949
1950 * Added ``If.is_sys_guard`` and ``If.is_typing_guard`` helper methods
1951
1952 * Fix a bad inference type for yield values inside of a derived class.
1953
1954 Closes pylint-dev/astroid#1090
1955
1956 * Fix a crash when the node is a 'Module' in the brain builtin inference
1957
1958 Closes pylint-dev/pylint#4671
1959
1960 * Fix issues when inferring match variables
1961
1962 Closes pylint-dev/pylint#4685
1963
1964 * Fix lookup for nested non-function scopes
1965
1966 * Fix issue that ``TypedDict`` instance wasn't callable.
1967
1968 Closes pylint-dev/pylint#4715
1969
1970 * Add dependency on setuptools and a guard to prevent related exceptions.
1971
1972
1973 What's New in astroid 2.6.2?
1974 ============================
1975 Release date: 2021-06-30
1976
1977 * Fix a crash when the inference of the length of a node failed
1978
1979 Closes pylint-dev/pylint#4633
1980
1981 * Fix unhandled StopIteration during inference, following the implementation
1982 of PEP479 in python 3.7+
1983
1984 Closes pylint-dev/pylint#4631
1985 Closes #1080
1986
1987
1988 What's New in astroid 2.6.1?
1989 ============================
1990 Release date: 2021-06-29
1991
1992 * Fix issue with ``TypedDict`` for Python 3.9+
1993
1994 Closes pylint-dev/pylint#4610
1995
1996
1997 What's New in astroid 2.6.0?
1998 ============================
1999 Release date: 2021-06-22
2000
2001 * Appveyor and travis are no longer used in the continuous integration
2002
2003 * ``setuptools_scm`` has been removed and replaced by ``tbump`` in order to not
2004 have hidden runtime dependencies to setuptools
2005
2006 * ``NodeNg``, the base node class, is now accessible from ``astroid`` or
2007 ``astroid.nodes`` as it can be used for typing.
2008
2009 * Update enum brain to improve inference of .name and .value dynamic class
2010 attributes
2011
2012 Closes pylint-dev/pylint#1932
2013 Closes pylint-dev/pylint#2062
2014 Closes pylint-dev/pylint#2306
2015
2016 * Removed ``Repr``, ``Exec``, and ``Print`` nodes as the ``ast`` nodes
2017 they represented have been removed with the change to Python 3
2018
2019 * Deprecate ``Ellipsis`` node. It will be removed with the next minor release.
2020 Checkers that already support Python 3.8+ work without issues. It's only
2021 necessary to remove all references to the ``astroid.Ellipsis`` node.
2022 This changes will make development of checkers easier as the resulting tree for Ellipsis
2023 will no longer depend on the python version. **Background**: With Python 3.8 the
2024 ``ast.Ellipsis`` node, along with ``ast.Str``, ``ast.Bytes``, ``ast.Num``,
2025 and ``ast.NamedConstant`` were merged into ``ast.Constant``.
2026
2027 * Deprecated ``Index`` and ``ExtSlice`` nodes. They will be removed with the
2028 next minor release. Both are now part of the ``Subscript`` node.
2029 Checkers that already support Python 3.9+ work without issues.
2030 It's only necessary to remove all references to the ``astroid.Index`` and
2031 ``astroid.ExtSlice`` nodes. This change will make development of checkers
2032 easier as the resulting tree for ``ast.Subscript`` nodes will no longer
2033 depend on the python version. **Background**: With Python 3.9 ``ast.Index``
2034 and ``ast.ExtSlice`` were merged into the ``ast.Subscript`` node.
2035
2036 * Updated all Match nodes to be internally consistent.
2037
2038 * Add ``Pattern`` base class.
2039
2040
2041 What's New in astroid 2.5.8?
2042 ============================
2043 Release date: 2021-06-07
2044
2045 * Improve support for Pattern Matching
2046
2047 * Add lineno and col_offset for ``Keyword`` nodes and Python 3.9+
2048
2049 * Add global inference cache to speed up inference of long statement blocks
2050
2051 * Add a limit to the total number of nodes inferred indirectly as a result
2052 of inferring some node
2053
2054
2055 What's New in astroid 2.5.7?
2056 ============================
2057 Release date: 2021-05-09
2058
2059 * Fix six.with_metaclass transformation so it doesn't break user defined transformations.
2060
2061 * Fix detection of relative imports.
2062 Closes #930
2063 Closes pylint-dev/pylint#4186
2064
2065 * Fix inference of instance attributes defined in base classes
2066
2067 Closes #932
2068
2069 * Update `infer_named_tuple` brain to reject namedtuple definitions
2070 that would raise ValueError
2071
2072 Closes #920
2073
2074 * Do not set instance attributes on builtin object()
2075
2076 Closes #945
2077 Closes pylint-dev/pylint#4232
2078 Closes pylint-dev/pylint#4221
2079 Closes pylint-dev/pylint#3970
2080 Closes pylint-dev/pylint#3595
2081
2082 * Fix some spurious cycles detected in ``context.path`` leading to more cases
2083 that can now be inferred
2084
2085 Closes #926
2086
2087 * Add ``kind`` field to ``Const`` nodes, matching the structure of the built-in ast Const.
2088 The kind field is "u" if the literal is a u-prefixed string, and ``None`` otherwise.
2089
2090 Closes #898
2091
2092 * Fix property inference in class contexts for properties defined on the metaclass
2093
2094 Closes #940
2095
2096 * Update enum brain to fix definition of __members__ for subclass-defined Enums
2097
2098 Closes pylint-dev/pylint#3535
2099 Closes pylint-dev/pylint#4358
2100
2101 * Update random brain to fix a crash with inference of some sequence elements
2102
2103 Closes #922
2104
2105 * Fix inference of attributes defined in a base class that is an inner class
2106
2107 Closes #904
2108
2109 * Allow inferring a return value of None for non-abstract empty functions and
2110 functions with no return statements (implicitly returning None)
2111
2112 Closes #485
2113
2114 * scm_setuptools has been added to the packaging.
2115
2116 * Astroid's tags are now the standard form ``vX.Y.Z`` and not ``astroid-X.Y.Z`` anymore.
2117
2118 * Add initial support for Pattern Matching in Python 3.10
2119
2120 What's New in astroid 2.5.6?
2121 ============================
2122 Release date: 2021-04-25
2123
2124 * Fix retro-compatibility issues with old version of pylint
2125 Closes pylint-dev/pylint#4402
2126
2127 What's New in astroid 2.5.5?
2128 ============================
2129 Release date: 2021-04-24
2130
2131 * Fixes the discord link in the project urls of the package.
2132 Closes pylint-dev/pylint#4393
2133
2134 What's New in astroid 2.5.4?
2135 ============================
2136 Release date: 2021-04-24
2137
2138 * The packaging is now done via setuptools exclusively. ``doc``, ``tests``, and ``Changelog`` are
2139 not packaged anymore - reducing the size of the package greatly.
2140
2141 * Debian packaging is now (officially) done in https://salsa.debian.org/python-team/packages/astroid.
2142
2143 * ``__pkginfo__`` now only contain ``__version__`` (also accessible with ``astroid.__version__``),
2144 other meta-information are still accessible with ``import importlib;metadata.metadata('astroid')``.
2145
2146 * Added inference tip for ``typing.Tuple`` alias
2147
2148 * Fix crash when evaluating ``typing.NamedTuple``
2149
2150 Closes pylint-dev/pylint#4383
2151
2152 * COPYING was removed in favor of COPYING.LESSER and the latter was renamed to LICENSE to make more apparent
2153 that the code is licensed under LGPLv2 or later.
2154
2155 * Moved from appveyor and travis to Github Actions for continuous integration.
2156
2157 What's New in astroid 2.5.3?
2158 ============================
2159 Release date: 2021-04-10
2160
2161 * Takes into account the fact that subscript inferring for a ClassDef may involve __class_getitem__ method
2162
2163 * Reworks the ``collections`` and ``typing`` brain so that pylint`s acceptance tests are fine.
2164
2165 Closes pylint-dev/pylint#4206
2166
2167 * Use ``inference_tip`` for ``typing.TypedDict`` brain.
2168
2169 * Fix mro for classes that inherit from typing.Generic
2170
2171 * Add inference tip for typing.Generic and typing.Annotated with ``__class_getitem__``
2172
2173 Closes pylint-dev/pylint#2822
2174
2175
2176 What's New in astroid 2.5.2?
2177 ============================
2178 Release date: 2021-03-28
2179
2180 * Detects `import numpy` as a valid `numpy` import.
2181
2182 Closes pylint-dev/pylint#3974
2183
2184 * Iterate over ``Keywords`` when using ``ClassDef.get_children``
2185
2186 Closes pylint-dev/pylint#3202
2187
2188 What's New in astroid 2.5.1?
2189 ============================
2190 Release date: 2021-02-28
2191
2192 * The ``context.path`` is reverted to a set because otherwise it leads to false positives
2193 for non `numpy` functions.
2194
2195 Closes #895 #899
2196
2197 * Don't transform dataclass ClassVars
2198
2199 * Improve typing.TypedDict inference
2200
2201 * Fix the `Duplicates found in MROs` false positive.
2202
2203 Closes #905
2204 Closes pylint-dev/pylint#2717
2205 Closes pylint-dev/pylint#3247
2206 Closes pylint-dev/pylint#4093
2207 Closes pylint-dev/pylint#4131
2208 Closes pylint-dev/pylint#4145
2209
2210
2211 What's New in astroid 2.5?
2212 ============================
2213 Release date: 2021-02-15
2214
2215 * Adds `attr_fset` in the `PropertyModel` class.
2216
2217 Fixes pylint-dev/pylint#3480
2218
2219 * Remove support for Python 3.5.
2220 * Remove the runtime dependency on ``six``. The ``six`` brain remains in
2221 astroid.
2222
2223 Fixes pylint-dev/astroid#863
2224
2225 * Enrich the ``brain_collection`` module so that ``__class_getitem__`` method is added to `deque` for
2226 ``python`` version above 3.9.
2227
2228 * The ``context.path`` is now a ``dict`` and the ``context.push`` method
2229 returns ``True`` if the node has been visited a certain amount of times.
2230
2231 Close #669
2232
2233 * Adds a brain for type object so that it is possible to write `type[int]` in annotation.
2234
2235 Fixes pylint-dev/pylint#4001
2236
2237 * Add ``__class_getitem__`` method to ``subprocess.Popen`` brain under Python 3.9 so that it is seen as subscriptable by pylint.
2238
2239 Fixes pylint-dev/pylint#4034
2240
2241
2242 * Adds `degrees`, `radians`, which are `numpy ufunc` functions, in the `numpy` brain. Adds `random` function in the `numpy.random` brain.
2243
2244 Fixes pylint-dev/pylint#3856
2245
2246 * Fix deprecated importlib methods
2247
2248 Closes #703
2249
2250 * Fix a crash in inference caused by `Uninferable` container elements
2251
2252 Close #866
2253
2254 * Add `python 3.9` support.
2255
2256 * The flat attribute of ``numpy.ndarray`` is now inferred as an ``numpy.ndarray`` itself.
2257 It should be a ``numpy.flatiter`` instance, but this class is not yet available in the numpy brain.
2258
2259 Fixes pylint-dev/pylint#3640
2260
2261 * Fix a bug for dunder methods inference of function objects
2262
2263 Fixes #819
2264
2265 * Fixes a bug in the signature of the ``ndarray.__or__`` method,
2266 in the ``brain_numpy_ndarray.py`` module.
2267
2268 Fixes #815
2269
2270 * Fixes a to-list cast bug in ``starred_assigned_stmts`` method, in the
2271 ``protocols.py`` module.
2272
2273 * Added a brain for ``hypothesis.strategies.composite``
2274
2275 * The transpose of a ``numpy.ndarray`` is also a ``numpy.ndarray``
2276
2277 Fixes pylint-dev/pylint#3387
2278
2279 * Added a brain for ``sqlalchemy.orm.session``
2280
2281 * Separate string and bytes classes patching
2282
2283 Fixes pylint-dev/pylint#3599
2284
2285 * Prevent recursion error for self referential length calls
2286
2287 Close #777
2288
2289 * Added missing methods to the brain for ``mechanize``, to fix pylint false positives
2290
2291 Close #793
2292
2293 * Added more supported parameters to ``subprocess.check_output``
2294
2295 * Fix recursion errors with pandas
2296
2297 Fixes pylint-dev/pylint#2843
2298 Fixes pylint-dev/pylint#2811
2299
2300 * Added exception inference for `UnicodeDecodeError`
2301
2302 Close pylint-dev/pylint#3639
2303
2304 * `FunctionDef.is_generator` properly handles `yield` nodes in `If` tests
2305
2306 Close pylint-dev/pylint#3583
2307
2308 * Fixed exception-chaining error messages.
2309
2310 * Fix failure to infer base class type with multiple inheritance and qualified names
2311
2312 Fixes #843
2313
2314 * Fix interpretation of ``six.with_metaclass`` class definitions.
2315
2316 Fixes #713
2317
2318 * Reduce memory usage of astroid's module cache.
2319
2320 * Remove dependency on `imp`.
2321
2322 Close #594
2323 Close #681
2324
2325 * Do not crash when encountering starred assignments in enums.
2326
2327 Close #835
2328
2329 * Fix a crash in functools.partial inference when the arguments cannot be determined
2330
2331 Close pylint-dev/pylint#3776
2332
2333 * Fix a crash caused by a lookup of a monkey-patched method
2334
2335 Close pylint-dev/pylint#3686
2336
2337 * ``is_generator`` correctly considers `Yield` nodes in `AugAssign` nodes
2338
2339 This fixes a false positive with the `assignment-from-no-return` pylint check.
2340
2341 Close pylint-dev/pylint#3904
2342
2343 * Corrected the parent of function type comment nodes.
2344
2345 These nodes used to be parented to their original ast.FunctionDef parent
2346 but are now correctly parented to their astroid.FunctionDef parent.
2347
2348 Close pylint-dev/astroid#851
2349
2350
2351 What's New in astroid 2.4.2?
2352 ============================
2353 Release date: 2020-06-08
2354
2355 * `FunctionDef.is_generator` properly handles `yield` nodes in `While` tests
2356
2357 Close pylint-dev/pylint#3519
2358
2359 * Properly construct the arguments of inferred property descriptors
2360
2361 Close pylint-dev/pylint#3648
2362
2363
2364 What's New in astroid 2.4.1?
2365 ============================
2366 Release date: 2020-05-05
2367
2368 * Handle the case where the raw builder fails to retrieve the ``__all__`` attribute
2369
2370 Close #772
2371
2372 * Restructure the AST parsing heuristic to always pick the same module
2373
2374 Close pylint-dev/pylint#3540
2375 Close #773
2376
2377 * Changed setup.py to work with [distlib](https://pypi.org/project/distlib)
2378
2379 Close #779
2380
2381 * Do not crash with SyntaxError when parsing namedtuples with invalid label
2382
2383 Close pylint-dev/pylint#3549
2384
2385 * Protect against ``infer_call_result`` failing with `InferenceError` in `Super.getattr()`
2386
2387 Close pylint-dev/pylint#3529
2388
2389
2390 What's New in astroid 2.4.0?
2391 ============================
2392 Release date: 2020-04-27
2393
2394 * Expose a ast_from_string method in AstroidManager, which will accept
2395 source code as a string and return the corresponding astroid object
2396
2397 Closes pylint-dev/astroid#725
2398
2399 * ``BoundMethod.implicit_parameters`` returns a proper value for ``__new__``
2400
2401 Close pylint-dev/pylint#2335
2402
2403 * Allow slots added dynamically to a class to still be inferred
2404
2405 Close pylint-dev/pylint#2334
2406
2407 * Allow `FunctionDef.getattr` to look into both instance attrs and special attributes
2408
2409 Close pylint-dev/pylint#1078
2410
2411 * Infer qualified ``classmethod`` as a classmethod.
2412
2413 Close pylint-dev/pylint#3417
2414
2415 * Prevent a recursion error to happen when inferring the declared metaclass of a class
2416
2417 Close #749
2418
2419 * Raise ``AttributeInferenceError`` when ``getattr()`` receives an empty name
2420
2421 Close pylint-dev/pylint#2991
2422
2423 * Prevent a recursion error for self reference variables and `type()` calls.
2424
2425 Close #199
2426
2427 * Do not infer the first argument of a staticmethod in a metaclass as the class itself
2428
2429 Close pylint-dev/pylint#3032
2430
2431 * ``NodeNG.bool_value()`` gained an optional ``context`` parameter
2432
2433 We need to pass an inference context downstream when inferring the boolean
2434 value of a node in order to prevent recursion errors and double inference.
2435
2436 This fix prevents a recursion error with dask library.
2437
2438 Close pylint-dev/pylint#2985
2439
2440 * Pass a context argument to ``astroid.Arguments`` to prevent recursion errors
2441
2442 Close pylint-dev/pylint#3414
2443
2444 * Better inference of class and static methods decorated with custom methods
2445
2446 Close pylint-dev/pylint#3209
2447
2448 * Reverse the order of decorators for `infer_subscript`
2449
2450 `path_wrapper` needs to come first, followed by `raise_if_nothing_inferred`,
2451 otherwise we won't handle `StopIteration` correctly.
2452
2453 Close #762
2454
2455 * Prevent a recursion error when inferring self-referential variables without definition
2456
2457 Close pylint-dev/pylint#1285
2458
2459 * Numpy `datetime64.astype` return value is inferred as a `ndarray`.
2460
2461 Close pylint-dev/pylint#3332
2462
2463 * Skip non ``Assign`` and ``AnnAssign`` nodes from enum reinterpretation
2464
2465 Closes pylint-dev/pylint#3365
2466
2467 * Numpy ``ndarray`` attributes ``imag`` and ``real`` are now inferred as ``ndarray``.
2468
2469 Close pylint-dev/pylint#3322
2470
2471 * Added a call to ``register_transform`` for all functions of the ``brain_numpy_core_multiarray``
2472 module in case the current node is an instance of ``astroid.Name``
2473
2474 Close #666
2475
2476 * Use the parent of the node when inferring aug assign nodes instead of the statement
2477
2478 Close pylint-dev/pylint#2911
2479 Close pylint-dev/pylint#3214
2480
2481 * Added some functions to the ``brain_numpy_core_umath`` module
2482
2483 Close pylint-dev/pylint#3319
2484
2485 * Added some functions of the ``numpy.core.multiarray`` module
2486
2487 Close pylint-dev/pylint#3208
2488
2489 * All the ``numpy ufunc`` functions derived now from a common class that
2490 implements the specific ``reduce``, ``accumulate``, ``reduceat``,
2491 ``outer`` and ``at`` methods.
2492
2493 Close pylint-dev/pylint#2885
2494
2495 * ``nodes.Const.itered`` returns a list of ``Const`` nodes, not strings
2496
2497 Close pylint-dev/pylint#3306
2498
2499 * The ``shape`` attribute of a ``numpy ndarray`` is now a ``ndarray``
2500
2501 Close pylint-dev/pylint#3139
2502
2503 * Don't ignore special methods when inspecting gi classes
2504
2505 Close #728
2506
2507 * Added transform for ``scipy.gaussian``
2508
2509 * Add support for inferring properties.
2510
2511 * Added a brain for ``responses``
2512
2513 * Allow inferring positional only arguments.
2514
2515 * Retry parsing a module that has invalid type comments
2516
2517 It is possible for a module to use comments that might be interpreted
2518 as type comments by the `ast` library. We do not want to completely crash on those
2519 invalid type comments.
2520
2521 Close #708
2522
2523 * Scope the inference to the current bound node when inferring instances of classes
2524
2525 When inferring instances of classes from arguments, such as ``self``
2526 in a bound method, we could use as a hint the context's ``boundnode``,
2527 which indicates the instance from which the inference originated.
2528 As an example, a subclass that uses a parent's method which returns
2529 ``self``, will override the ``self`` to point to it instead of pointing
2530 to the parent class.
2531
2532 Close pylint-dev/pylint#3157
2533
2534 * Add support for inferring exception instances in all contexts
2535
2536 We were able to infer exception instances as ``ExceptionInstance``
2537 only for a handful of cases, but not all. ``ExceptionInstance`` has
2538 support for better inference of `.args` and other exception related
2539 attributes that normal instances do not have.
2540 This additional support should remove certain false positives related
2541 to ``.args`` and other exception attributes in ``pylint``.
2542
2543 Close pylint-dev/pylint#2333
2544
2545 * Add more supported parameters to ``subprocess.check_output``
2546
2547 Close #722
2548
2549 * Infer args unpacking of ``self``
2550
2551 Certain stdlib modules use ``*args`` to encapsulate
2552 the ``self`` parameter, which results in uninferable
2553 instances given we rely on the presence of the ``self``
2554 argument to figure out the instance where we should be
2555 setting attributes.
2556
2557 Close pylint-dev/pylint#3216
2558
2559 * Clean up setup.py
2560
2561 Make pytest-runner a requirement only if running tests, similar to what was
2562 done with McCabe.
2563
2564 Clean up the setup.py file, resolving a handful of minor warnings with it.
2565
2566 * Handle StopIteration error in infer_int.
2567
2568 Close pylint-dev/pylint#3274
2569
2570 * Can access per argument type comments for positional only and keyword only arguments.
2571
2572 The comments are accessed through through the new
2573 ``Arguments.type_comment_posonlyargs`` and
2574 ``Arguments.type_comment_kwonlyargs`` attributes respectively.
2575
2576 * Relax upper bound on `wrapt`
2577
2578 Close #755
2579
2580 * Properly analyze CFFI compiled extensions.
2581
2582 What's New in astroid 2.3.2?
2583 ============================
2584 Release date: 2019-10-18
2585
2586 * All type comments have as parent the corresponding `astroid` node
2587
2588 Until now they had as parent the builtin `ast` node which meant
2589 we were operating with primitive objects instead of our own.
2590
2591 Close pylint-dev/pylint#3174
2592
2593
2594 * Pass an inference context to `metaclass()` when inferring an object type
2595
2596 This should prevent a bunch of recursion errors happening in pylint.
2597 Also refactor the inference of `IfExp` nodes to use separate contexts
2598 for each potential branch.
2599
2600 Close pylint-dev/pylint#3152
2601 Close pylint-dev/pylint#3159
2602
2603
2604 What's New in astroid 2.3.1?
2605 ============================
2606 Release date: 2019-09-30
2607
2608 * A transform for the builtin `dataclasses` module was added.
2609
2610 This should address various `dataclasses` issues that were surfaced
2611 even more after the release of pylint 2.4.0.
2612 In the previous versions of `astroid`, annotated assign nodes were
2613 allowed to be retrieved via `getattr()` but that no longer happens
2614 with the latest `astroid` release, as those attribute are not actual
2615 attributes, but rather virtual ones, thus an operation such as `getattr()`
2616 does not make sense for them.
2617
2618 * Update attr brain to partly understand annotated attributes
2619
2620 Close #656
2621
2622
2623 What's New in astroid 2.3.0?
2624 ============================
2625 Release date: 2019-09-24
2626
2627 * Add a brain tip for ``subprocess.check_output``
2628
2629 Close #689
2630
2631 * Remove NodeNG.nearest method because of lack of usage in astroid and pylint.
2632
2633 Close #691
2634
2635 * Allow importing wheel files. Close #541
2636
2637 * Annotated AST follows PEP8 coding style when converted to string.
2638
2639 * Fix a bug where defining a class using type() could cause a DuplicateBasesError.
2640
2641 Close #644
2642
2643 * Dropped support for Python 3.4.
2644
2645 * Numpy brain support is improved.
2646
2647 Numpy's fundamental type ``numpy.ndarray`` has its own brain : ``brain_numpy_ndarray`` and
2648 each numpy module that necessitates brain action has now its own numpy brain :
2649
2650 - ``numpy.core.numeric``
2651 - ``numpy.core.function_base``
2652 - ``numpy.core.multiarray``
2653 - ``numpy.core.numeric``
2654 - ``numpy.core.numerictypes``
2655 - ``numpy.core.umath``
2656 - ``numpy.random.mtrand``
2657
2658 Close pylint-dev/pylint#2865
2659 Close pylint-dev/pylint#2747
2660 Close pylint-dev/pylint#2721
2661 Close pylint-dev/pylint#2326
2662 Close pylint-dev/pylint#2021
2663
2664 * ``assert`` only functions are properly inferred as returning ``None``
2665
2666 Close #668
2667
2668 * Add support for Python 3.8's `NamedExpr` nodes, which is part of assignment expressions.
2669
2670 Close #674
2671
2672 * Added support for inferring `IfExp` nodes.
2673
2674 * Instances of exceptions are inferred as such when inferring in non-exception context
2675
2676 This allows special inference support for exception attributes such as `.args`.
2677
2678 Close pylint-dev/pylint#2333
2679
2680 * Drop a superfluous and wrong callcontext when inferring the result of a context manager
2681
2682 Close pylint-dev/pylint#2859
2683
2684 * ``igetattr`` raises ``InferenceError`` on re-inference of the same object
2685
2686 This prevents ``StopIteration`` from leaking when we encounter the same
2687 object in the current context, which could result in various ``RuntimeErrors``
2688 leaking in other parts of the inference.
2689 Until we get a global context per inference, the solution is sort of a hack,
2690 as with the suggested global context improvement, we could theoretically
2691 reuse the same inference object.
2692
2693 Close #663
2694
2695 * Variable annotations can no longer be retrieved with `ClassDef.getattr`
2696
2697 Unless they have an attached value, class variable annotations can no longer
2698 be retrieved with `ClassDef.getattr.`
2699
2700 * Improved builtin inference for ``tuple``, ``set``, ``frozenset``, ``list`` and ``dict``
2701
2702 We were properly inferring these callables *only* if they had consts as
2703 values, but that is not the case most of the time. Instead we try to infer
2704 the values that their arguments can be and use them instead of assuming
2705 Const nodes all the time.
2706
2707 Close pylint-dev/pylint#2841
2708
2709 * The last except handler wins when inferring variables bound in an except handler.
2710
2711 Close pylint-dev/pylint#2777
2712
2713
2714 * ``threading.Lock.locked()`` is properly recognized as a member of ``threading.Lock``
2715
2716 Close pylint-dev/pylint#2791
2717
2718
2719 * Fix recursion error involving ``len`` and self referential attributes
2720
2721 Close pylint-dev/pylint#2736
2722 Close pylint-dev/pylint#2734
2723 Close pylint-dev/pylint#2740
2724
2725 * Can access per argument type comments through new ``Arguments.type_comment_args`` attribute.
2726
2727 Close #665
2728
2729 * Fix being unable to access class attributes on a NamedTuple.
2730
2731 Close pylint-dev/pylint#1628
2732
2733 * Fixed being unable to find distutils submodules by name when in a virtualenv.
2734
2735 Close pylint-dev/pylint#73
2736
2737 What's New in astroid 2.2.0?
2738 ============================
2739 Release date: 2019-02-27
2740
2741
2742 * Fix a bug concerning inference of calls to numpy function that should not return Tuple or List instances.
2743
2744 Close pylint-dev/pylint#2436
2745
2746 * Fix a bug where a method, which is a lambda built from a function, is not inferred as ``BoundMethod``
2747
2748 Close pylint-dev/pylint#2594
2749
2750 * ``typed_ast`` gets installed for Python 3.7, meaning type comments can now work on 3.7.
2751
2752 * Fix a bug concerning inference of unary operators on numpy types.
2753
2754 Close pylint-dev/pylint#2436 (first part)
2755
2756 * Fix a crash with ``typing.NamedTuple`` and empty fields. Close pylint-dev/pylint#2745
2757
2758 * Add a proper ``strerror`` inference to the ``OSError`` exceptions.
2759
2760 Close pylint-dev/pylint#2553
2761
2762 * Support non-const nodes as values of Enum attributes.
2763
2764 Close #612
2765
2766 * Fix a crash in the ``enum`` brain tip caused by non-assign members in class definitions.
2767
2768 Close pylint-dev/pylint#2719
2769
2770 * ``brain_numpy`` returns an undefined type for ``numpy`` methods to avoid ``assignment-from-no-return``
2771
2772 Close pylint-dev/pylint#2694
2773
2774 * Fix a bug where a call to a function that has been previously called via
2775 functools.partial was wrongly inferred
2776
2777 Close pylint-dev/pylint#2588
2778
2779 * Fix a recursion error caused by inferring the ``slice`` builtin.
2780
2781 Close pylint-dev/pylint#2667
2782
2783 * Remove the restriction that "old style classes" cannot have a MRO.
2784
2785 This does not make sense any longer given that we run against Python 3
2786 code.
2787 Close pylint-dev/pylint#2701
2788
2789 * Added more builtin exceptions attributes. Close #580
2790
2791 * Add a registry for builtin exception models. Close pylint-dev/pylint#1432
2792
2793 * Add brain tips for `http.client`. Close pylint-dev/pylint#2687
2794
2795 * Prevent crashing when processing ``enums`` with mixed single and double quotes.
2796
2797 Close pylint-dev/pylint#2676
2798
2799 * ``typing`` types have the `__args__` property. Close pylint-dev/pylint#2419
2800
2801 * Fix a bug where an Attribute used as a base class was triggering a crash
2802
2803 Close #626
2804
2805 * Added special support for `enum.IntFlag`
2806
2807 Close pylint-dev/pylint#2534
2808
2809 * Extend detection of data classes defined with attr
2810
2811 Close #628
2812
2813 * Fix typo in description for brain_attrs
2814
2815
2816 What's New in astroid 2.1.0?
2817 ============================
2818 Release date: 2018-11-25
2819
2820 * ``threading.Lock.acquire`` has the ``timeout`` parameter now.
2821
2822 Close pylint-dev/pylint#2457
2823
2824 * Pass parameters by keyword name when inferring sequences.
2825
2826 Close pylint-dev/pylint#2526
2827
2828 * Correct line numbering for f-strings for complex embedded expressions
2829
2830 When a f-string contained a complex expression, such as an attribute access,
2831 we weren't cloning all the subtree of the f-string expression for attaching the correct
2832 line number. This problem is coming from the builtin AST parser which gives for the f-string
2833 and for its underlying elements the line number 1, but this is causing all sorts of bugs and
2834 problems in pylint, which expects correct line numbering.
2835
2836 Close pylint-dev/pylint#2449
2837
2838 * Add support for `argparse.Namespace`
2839
2840 Close pylint-dev/pylint#2413
2841
2842 * `async` functions are now inferred as `AsyncGenerator` when inferring their call result.
2843
2844 * Filter out ``Uninferable`` when inferring the call result result of a class with an uninferable ``__call__`` method.
2845
2846 Close pylint-dev/pylint#2434
2847
2848 * Make compatible with AST changes in Python 3.8.
2849
2850 * Subscript inference (e.g. "`a[i]`") now pays attention to multiple inferred values for value
2851 (e.g. "`a`") and slice (e.g. "`i`")
2852
2853 Close #614
2854
2855 What's New in astroid 2.0.4?
2856 ============================
2857 Release date: 2018-08-10
2858
2859 * Make sure that assign nodes can find ``yield`` statements in their values
2860
2861 Close pylint-dev/pylint#2400
2862
2863 What's New in astroid 2.0.3?
2864 ============================
2865
2866 Release date: 2018-08-08
2867
2868 * The environment markers for PyPy were invalid.
2869
2870 What's New in astroid 2.0.2?
2871 ============================
2872
2873 Release date: 2018-08-01
2874
2875 * Stop repeat inference attempt causing a RuntimeError in Python3.7
2876
2877 Close pylint-dev/pylint#2317
2878
2879 * infer_call_result can raise InferenceError so make sure to handle that for the call sites
2880 where it is used
2881
2882 infer_call_result started recently to raise InferenceError for objects for which it
2883 could not find any returns. Previously it was silently raising a StopIteration,
2884 which was especially leaking when calling builtin methods.
2885 Since it is after all an inference method, it is expected that it
2886 could raise an InferenceError rather than returning nothing.
2887
2888 Close pylint-dev/pylint#2350
2889
2890
2891 What's New in astroid 2.0.1?
2892 ============================
2893
2894 Release date: 2018-07-19
2895
2896 * Released to clear an old wheel package on PyPI
2897
2898
2899 What's New in astroid 2.0?
2900 ==========================
2901
2902 Release date: 2018-07-15
2903
2904 * String representation of nodes takes in account precedence and associativity rules of operators.
2905
2906 * Fix loading files with `modutils.load_from_module` when
2907 the path that contains it in `sys.path` is a symlink and
2908 the file is contained in a symlinked folder.
2909
2910 Close #583
2911
2912 * Reworking of the numpy brain dealing with numerictypes
2913 (use of inspect module to determine the class hierarchy of
2914 numpy.core.numerictypes module)
2915
2916 Close pylint-dev/pylint#2140
2917
2918 * Added inference support for starred nodes in for loops
2919
2920 Close #146
2921
2922 * Support unpacking for dicts in assignments
2923
2924 Close #268
2925
2926 * Add support for inferring functools.partial
2927
2928 Close #125
2929
2930 * Inference support for `dict.fromkeys`
2931
2932 Close #110
2933
2934 * `int()` builtin is inferred as returning integers.
2935
2936 Close #150
2937
2938 * `str()` builtin is inferred as returning strings.
2939
2940 Close #148
2941
2942 * DescriptorBoundMethod has the correct number of arguments defined.
2943
2944 * Improvement of the numpy numeric types definition.
2945
2946 Close pylint-dev/pylint#1971
2947
2948 * Subclasses of *property* are now interpreted as properties
2949
2950 Close pylint-dev/pylint#1601
2951
2952 * AsStringRegexpPredicate has been removed.
2953
2954 Use transform predicates instead of it.
2955
2956 * Switched to using typed_ast for getting access to type comments
2957
2958 As a side effect of this change, some nodes gained a new `type_annotation` attribute,
2959 which, if the type comments were correctly parsed, should contain a node object
2960 with the corresponding objects from the type comment.
2961
2962 * typing.X[...] and typing.NewType are inferred as classes instead of instances.
2963
2964 * Module.__path__ is now a list
2965
2966 It used to be a string containing the path, but it doesn't reflect the situation
2967 on Python, where it is actually a list.
2968
2969 * Fix a bug with namespace package's __path__ attribute.
2970
2971 Close #528
2972
2973 * Added brain tips for random.sample
2974
2975 Part of pylint-dev/pylint#811
2976
2977 * Add brain tip for `issubclass` builtin
2978
2979 Close #101.
2980
2981 * Fix submodule imports from six
2982
2983 Close pylint-dev/pylint#1640
2984
2985 * Fix missing __module__ and __qualname__ from class definition locals
2986
2987 Close pylint-dev/pylint#1753
2988
2989 * Fix a crash when __annotations__ access a parent's __init__ that does not have arguments
2990
2991 Close #473
2992
2993 * Fix multiple objects sharing the same InferenceContext.path causing uninferable results
2994
2995 Close #483
2996
2997 * Fix improper modification of col_offset, lineno upon inference of builtin functions
2998
2999 Close pylint-dev/pylint#1839
3000
3001 * Subprocess.Popen brain now knows of the args member
3002
3003 Close pylint-dev/pylint#1860
3004
3005 * add move_to_end method to collections.OrderedDict brain
3006
3007 Close pylint-dev/pylint#1872
3008
3009 * Include new hashlib classes added in python 3.6
3010
3011 * Fix RecursionError for augmented assign
3012
3013 Close #437, #447, #313, pylint-dev/pylint#1642, pylint-dev/pylint#1805, pylint-dev/pylint#1854, pylint-dev/pylint#1452
3014
3015 * Add missing attrs special attribute
3016
3017 Close pylint-dev/pylint#1884
3018
3019 * Inference now understands the 'isinstance' builtin
3020
3021 Close #98
3022
3023 * Stop duplicate nodes with the same key values
3024 from appearing in dictionaries from dictionary unpacking.
3025
3026 Close pylint-dev/pylint#1843
3027
3028 * Fix ``contextlib.contextmanager`` inference for nested context managers
3029
3030 Close #1699
3031
3032 * Implement inference for len builtin
3033
3034 Close #112
3035
3036 * Add qname method to Super object preventing potential errors in upstream
3037 pylint
3038
3039 Close #533
3040
3041 * Stop astroid from getting stuck in an infinite loop if a function shares
3042 its name with its decorator
3043
3044 Close #375
3045
3046 * Fix issue with inherited __call__ improperly inferencing self
3047
3048 Close #pylint-dev/pylint#2199
3049
3050 * Fix __call__ precedence for classes with custom metaclasses
3051
3052 Close pylint-dev/pylint#2159
3053
3054 * Limit the maximum amount of interable result in an NodeNG.infer() call to
3055 100 by default for performance issues with variables with large amounts of
3056 possible values.
3057
3058 The max inferable value can be tuned by setting the `max_inferable_values` flag on
3059 astroid.MANAGER.
3060
3061
3062 What's New in astroid 1.6.0?
3063 ============================
3064
3065 Release date: 2017-12-15
3066
3067
3068 * When verifying duplicates classes in MRO, ignore on-the-fly generated classes
3069
3070 Close pylint-dev/pylint#1706
3071
3072 * Add brain tip for attrs library to prevent unsupported-assignment-operation false positives
3073
3074 Close pylint-dev/pylint#1698
3075
3076 * file_stream was removed, since it was deprecated for three releases
3077
3078 Instead one should use the .stream() method.
3079
3080 * Vast improvements to numpy support
3081
3082 * Add brain tips for curses
3083
3084 Close pylint-dev/pylint#1703
3085
3086 * Add brain tips for UUID.int
3087
3088 Close pylint-dev/pylint#961
3089
3090 * The result of using object.__new__ as class decorator is correctly inferred as instance
3091
3092 Close #172
3093
3094 * Enums created with functional syntax are now iterable
3095
3096 * Enums created with functional syntax are now subscriptable
3097
3098 * Don't crash when getting the string representation of BadUnaryOperationMessage
3099
3100 In some cases, when the operand does not have a .name attribute,
3101 getting the string representation of a BadUnaryOperationMessage leads
3102 to a crash.
3103
3104 Close pylint-dev/pylint#1563
3105
3106 * Don't raise DuplicateBaseError when classes at different locations are used
3107
3108 For instance, one can implement a namedtuple base class, which gets reused
3109 on a class with the same name later on in the file. Until now, we considered
3110 these two classes as being the same, because they shared the name, but in fact
3111 they are different, being created at different locations and through different
3112 means.
3113
3114 Close pylint-dev/pylint#1458
3115
3116 * The func form of namedtuples with keywords is now understood
3117
3118 Close pylint-dev/pylint#1530
3119
3120 * Fix inference for nested calls
3121
3122 * Dunder class at method level is now inferred as the class of the method
3123
3124 Close pylint-dev/pylint#1328
3125
3126 * Stop most inference tip overwrites from happening by using
3127 predicates on existing inference_tip transforms.
3128
3129 Close #472
3130
3131 * Fix object.__new__(cls) calls in classmethods by using
3132 a context which has the proper boundnode for the given
3133 argument
3134
3135 Close #404
3136
3137 * Fix Pathlib type inference
3138
3139 Close pylint-dev/pylint#224
3140 Close pylint-dev/pylint#1660
3141
3142
3143
3144 What's New in astroid 1.5.3?
3145 ============================
3146
3147 Release date: 2017-06-03
3148
3149
3150 * enum34 dependency is forced to be at least version 1.1.3. Fixes spurious
3151 bug related to enum classes being falsy in boolean context, which caused
3152 ``_Inconsistent Hierarchy_`` ``RuntimeError`` in ``singledispatch`` module.
3153
3154 See links below for details:
3155 - http://bugs.python.org/issue26748
3156 - https://bitbucket.org/ambv/singledispatch/issues/8/inconsistent-hierarchy-with-enum
3157 - https://bitbucket.org/stoneleaf/enum34/commits/da50803651ab644e6fce66ebc85562f1117c344b
3158
3159 * Do not raise an exception when uninferable value is unpacked in ``with`` statement.
3160
3161 * Lock objects from ``threading`` module are now correctly recognised
3162 as context managers.
3163
3164
3165 What's New in astroid 1.5.2?
3166 ============================
3167
3168 Release date: 2017-04-17
3169
3170
3171 * Basic support for the class form of typing.NamedTuple
3172
3173 * mro() can be computed for classes with old style classes in the hierarchy
3174
3175
3176
3177 What's New in astroid 1.5.0?
3178 ============================
3179
3180 Release date: 2017-04-13
3181
3182
3183 * Arguments node gained a new attribute, ``kwonlyargs_annotations``
3184
3185 This new attribute holds the annotations for the keyword-only
3186 arguments.
3187
3188 * `namedtuple` inference now understands `rename` keyword argument
3189
3190 * Classes can now know their definition-time arguments.
3191
3192 Classes can support keyword arguments, which are passed when
3193 a class is constructed using ``__new__``.
3194
3195 * Add support for inferring typing.NamedTuple.
3196
3197 * ClassDef now supports __getitem__ inference through the metaclass.
3198
3199 * getitem() method accepts nodes now, instead of Python objects.
3200
3201 * Add support for explicit namespace packages, created with pkg_resources.
3202
3203 * Add brain tips for _io.TextIOWrapper's buffer and raw attributes.
3204
3205 * Add `returns` into the proper order in FunctionDef._astroid_fields
3206
3207 The order is important, since it determines the last child,
3208 which in turn determines the last line number of a scoped node.
3209
3210 * Add brain tips for functools.lru_cache.
3211
3212 * New function, astroid.extract_node, exported out from astroid.test_utils.
3213
3214 * Stop saving assignment locals in ExceptHandlers, when the context is a store.
3215
3216 This fixes a tripping case, where the RHS of a ExceptHandler can be redefined
3217 by the LHS, leading to a local save. For instance, ``except KeyError, exceptions.IndexError``
3218 could result in a local save for IndexError as KeyError, resulting in potential unexpected
3219 inferences. Since we don't lose a lot, this syntax gets prohibited.
3220
3221 * Fix a crash which occurred when the class of a namedtuple could not be inferred.
3222
3223 * Add support for implicit namespace packages (PEP 420)
3224
3225 This change involves a couple of modifications. First, we're relying on a
3226 spec finder protocol, inspired by importlib's ModuleSpec, for finding where
3227 a file or package is, using importlib's PathFinder as well, which enable
3228 us to discover namespace packages as well.
3229 This discovery is the center piece of the namespace package support,
3230 the other part being the construction of a dummy Module node whenever
3231 a namespace package root directory is requested during astroid's import
3232 references.
3233
3234 * Introduce a special attributes model
3235
3236 Through this model, astroid starts knowing special attributes of certain Python objects,
3237 such as functions, classes, super objects and so on. This was previously possible before,
3238 but now the lookup and the attributes themselves are separated into a new module,
3239 objectmodel.py, which describes, in a more comprehensive way, the data model of each
3240 object.
3241
3242 * Exceptions have their own object model
3243
3244 Some of exceptions's attributes, such as .args and .message,
3245 can't be inferred correctly since they are descriptors that get
3246 transformed into the proper objects at runtime. This can cause issues
3247 with the static analysis, since they are inferred as different than
3248 what's expected. Now when we're creating instances of exceptions,
3249 we're inferring a special object that knows how to transform those
3250 runtime attributes into the proper objects via a custom object model.
3251 Closes issue #81
3252
3253 * dict.values, dict.keys and dict.items are properly
3254 inferred to their corresponding type, which also
3255 includes the proper containers for Python 3.
3256
3257 * Fix a crash which occurred when a method had a same name as a builtin object,
3258 decorated at the same time by that builtin object ( a property for instance)
3259
3260 * The inference can handle the case where the attribute is accessed through a subclass
3261 of a base class and the attribute is defined at the base class's level,
3262 by taking in consideration a redefinition in the subclass.
3263
3264 This should fix https://github.com/pylint-dev/pylint/issues/432
3265
3266 * Calling lambda methods (defined at class level) can be understood.
3267
3268 * Don't take in consideration invalid assignments, especially when __slots__
3269 declaration forbids them.
3270
3271 Close issue #332
3272
3273 * Functional form of enums support accessing values through __call__.
3274
3275 * Brain tips for the ssl library.
3276
3277 * decoratornames() does not leak InferenceError anymore.
3278
3279 * wildcard_imported_names() got replaced by _public_names()
3280
3281 Our understanding of wildcard imports through __all__ was
3282 half baked to say at least, since we couldn't account for
3283 modifications of the list, which results in tons of false positives.
3284 Instead, we replaced it with _public_names(), a method which returns
3285 all the names that are publicly available in a module, that is that
3286 don't start with an underscore, even though this means that there
3287 is a possibility for other names to be leaked out even though
3288 they are not present in the __all__ variable.
3289
3290 The method is private in 1.4.X.
3291
3292 * unpack_infer raises InferenceError if it can't operate
3293 with the given sequences of nodes.
3294
3295 * Support accessing properties with super().
3296
3297 * Enforce strong updates per frames.
3298
3299 When looking up a name in a scope, Scope.lookup will return
3300 only the values which will be reachable after execution, as seen
3301 in the following code:
3302
3303 a = 1
3304 a = 2
3305
3306 In this case it doesn't make sense to return two values, but
3307 only the last one.
3308
3309 * Add support for inference on threading.Lock
3310
3311 As a matter of fact, astroid can infer on threading.RLock,
3312 threading.Semaphore, but can't do it on threading.Lock (because it comes
3313 from an extension module).
3314
3315 * pkg_resources brain tips are a bit more specific,
3316 by specifying proper returns.
3317
3318 * The slots() method conflates all the slots from the ancestors
3319 into a list of current and parent slots.
3320
3321 We're doing this because this is the right semantics of slots,
3322 they get inherited, as long as each parent defines a __slots__
3323 entry.
3324
3325 * Some nodes got a new attribute, 'ctx', which tells in which context
3326 the said node was used.
3327
3328 The possible values for the contexts are `Load` ('a'), `Del`
3329 ('del a'), `Store` ('a = 4') and the nodes that got the new
3330 attribute are Starred, Subscript, List and Tuple. Closes issue #267.
3331
3332 * relative_to_absolute_name or methods calling it will now raise
3333 TooManyLevelsError when a relative import was trying to
3334 access something beyond the top-level package.
3335
3336 * AstroidBuildingException is now AstroidBuildingError. The first
3337 name will exist until astroid 2.0.
3338
3339 * Add two new exceptions, AstroidImportError and AstroidSyntaxError.
3340 They are subclasses of AstroidBuildingException and are raised when
3341 a module can't be imported from various reasons.
3342 Also do_import_module lets the errors to bubble up without converting
3343 them to InferenceError. This particular conversion happens only
3344 during the inference.
3345
3346 * Revert to using printf-style formatting in as_string, in order
3347 to avoid a potential problem with encodings when using .format.
3348 Closes issue #273. Patch by notsqrt.
3349
3350 * assigned_stmts methods have the same signature from now on.
3351
3352 They used to have different signatures and each one made
3353 assumptions about what could be passed to other implementations,
3354 leading to various possible crashes when one or more arguments
3355 weren't given. Closes issue #277.
3356
3357 * Fix metaclass detection, when multiple keyword arguments
3358 are used in class definition.
3359
3360 * Add support for annotated variable assignments (PEP 526)
3361
3362 * Starred expressions are now inferred correctly for tuple,
3363 list, set, and dictionary literals.
3364
3365 * Support for asynchronous comprehensions introduced in Python 3.6.
3366
3367 Fixes #399. See PEP530 for details.
3368
3369
3370 What's New in astroid 1.4.1?
3371 ============================
3372
3373 Release date: 2015-11-29
3374
3375
3376 * Add support for handling Uninferable nodes when calling as_string
3377
3378 Some object, for instance List or Tuple can have, after inference,
3379 Uninferable as their elements, happening when their components
3380 weren't couldn't be inferred properly. This means that as_string
3381 needs to cope with expecting Uninferable nodes part of the other
3382 nodes coming for a string transformation. The patch adds a visit
3383 method in AsString and ``accept`` on Yes / Uninferable nodes.
3384 Closes issue #270.
3385
3386
3387
3388 What's New in astroid 1.4.0?
3389 ============================
3390
3391 Release date: 2015-11-29
3392
3393
3394 * Class.getattr('__mro__') returns the actual MRO. Closes issue #128.
3395
3396 * The logilab-common dependency is not needed anymore as the needed code
3397 was integrated into astroid.
3398
3399 * Generated enum member stubs now support IntEnum and multiple
3400 base classes.
3401
3402 * astroid.builder.AstroidBuilder.string_build and
3403 astroid.builder.AstroidBuilder.file_build are now raising
3404 AstroidBuildingException when the parsing of the string raises
3405 a SyntaxError.
3406
3407 * Add brain tips for multiprocessing.Manager and
3408 multiprocessing.managers.SyncManager.
3409
3410 * Add some fixes which enhances the Jython support.
3411 The fix mostly includes updates to modutils, which is
3412 modified in order to properly lookup paths from live objects,
3413 which ends in $py.class, not pyc as for Python 2,
3414 Closes issue #83.
3415
3416 * The Generator objects inferred with `infer_call_result`
3417 from functions have as parent the function from which they
3418 are returned.
3419
3420 * Add brain tips for multiprocessing post Python 3.4+,
3421 where the module level functions are retrieved with getattr
3422 from a context object, leading to many no-member errors
3423 in Pylint.
3424
3425 * Understand partially the 3-argument form of `type`.
3426 The only change is that astroid understands members
3427 passed in as dictionaries as the third argument.
3428
3429 * .slots() will return an empty list for classes with empty slots.
3430 Previously it returned None, which is the same value for
3431 classes without slots at all. This was changed in order
3432 to better reflect what's actually happening.
3433
3434 * Improve the inference of Getattr nodes when dealing with
3435 abstract properties from the abc module.
3436
3437 In astroid.bases.Instance._wrap_attr we had a detection
3438 code for properties, which basically inferred whatever
3439 a property returned, passing the results up the stack,
3440 to the igetattr() method. It handled only the builtin property
3441 but the new patch also handles a couple of other properties,
3442 such as abc.abstractproperty.
3443
3444 * UnboundMethod.getattr calls the getattr of its _proxied object
3445 and doesn't call super(...) anymore.
3446
3447 It previously crashed, since the first ancestor in its mro was
3448 bases.Proxy and bases.Proxy doesn't implement the .getattr method.
3449 Closes issue #91.
3450
3451 * Don't hard fail when calling .mro() on a class which has
3452 combined both newstyle and old style classes. The class
3453 in question is actually newstyle (and the __mro__ can be
3454 retrieved using Python).
3455
3456 .mro() fallbacks to using .ancestors() in that case.
3457
3458 * Class.local_attr and Class.local_attr_ancestors uses internally
3459 a mro lookup, using .mro() method, if they can.
3460
3461 That means for newstyle classes, when trying to lookup a member
3462 using one of these functions, the first one according to the
3463 mro will be returned. This reflects nicely the reality,
3464 but it can have as a drawback the fact that it is a behaviour
3465 change (the previous behaviour was incorrect though). Also,
3466 having bases which can return multiple values when inferred
3467 will not work with the new approach, because .mro() only
3468 retrieves the first value inferred from a base.
3469
3470 * Expose an implicit_metaclass() method in Class. This will return
3471 a builtins.type instance for newstyle classes.
3472
3473 * Add two new exceptions for handling MRO error cases. DuplicateBasesError
3474 is emitted when duplicate bases are found in a class,
3475 InconsistentMroError is raised when the method resolution is determined
3476 to be inconsistent. They share a common class, MroError, which
3477 is a subclass of ResolveError, meaning that this change is backwards
3478 compatible.
3479
3480 * Classes aren't marked as interfaces anymore, in the `type` attribute.
3481
3482 * Class.has_dynamic_getattr doesn't return True for special methods
3483 which aren't implemented in pure Python, as it is the case for extension modules.
3484
3485 Since most likely the methods were coming from a live object, this implies
3486 that all of them will have __getattr__ and __getattribute__ present and it
3487 is wrong to consider that those methods were actually implemented.
3488
3489 * Add basic support for understanding context managers.
3490
3491 Currently, there's no way to understand whatever __enter__ returns in a
3492 context manager and what it is bound using the ``as`` keyword. With these changes,
3493 we can understand ``bar`` in ``with foo() as bar``, which will be the result of __enter__.
3494
3495 * Add a new type of node, called *inference objects*. Inference objects are similar with
3496 AST nodes, but they can be obtained only after inference, so they can't be found
3497 inside the original AST tree. Their purpose is to handle at astroid level
3498 some operations which can't be handled when using brain transforms.
3499 For instance, the first object added is FrozenSet, which can be manipulated
3500 at astroid's level (inferred, itered etc). Code such as this 'frozenset((1,2))'
3501 will not return an Instance of frozenset, without having access to its
3502 content, but a new objects.FrozenSet, which can be used just as a nodes.Set.
3503
3504 * Add a new *inference object* called Super, which also adds support for understanding
3505 super calls. astroid understands the zero-argument form of super, specific to
3506 Python 3, where the interpreter fills itself the arguments of the call. Also, we
3507 are understanding the 2-argument form of super, both for bounded lookups
3508 (super(X, instance)) as well as for unbounded lookups (super(X, Y)),
3509 having as well support for validating that the object-or-type is a subtype
3510 of the first argument. The unbounded form of super (one argument) is not
3511 understood, since it's useless in practice and should be removed from
3512 Python's specification. Closes issue #89.
3513
3514 * Add inference support for getattr builtin. Now getattr builtins are
3515 properly understood. Closes issue #103.
3516
3517 * Add inference support for hasattr builtin. Closes issue #102.
3518
3519 * Add 'assert_equals' method in nose.tools's brain plugin.
3520
3521 * Don't leak StopIteration when inferring invalid UnaryOps (+[], +None etc.).
3522
3523 * Improve the inference of UnaryOperands.
3524
3525 When inferring unary operands, astroid looks up the return value
3526 of __pos__, __neg__ and __invert__ to determine the inferred value
3527 of ``~node``, ``+node`` or ``-node``.
3528
3529 * Improve the inference of six.moves, especially when using `from ... import ...`
3530 syntax. Also, we added a new fail import hook for six.moves, which fixes the
3531 import-error false positive from pylint. Closes issue #107.
3532
3533 * Make the first steps towards detecting type errors for unary and binary
3534 operations.
3535
3536 In exceptions, one object was added for holding information about a possible
3537 UnaryOp TypeError, object called `UnaryOperationError`. Even though the name
3538 suggests it's an exception, it's actually not one. When inferring UnaryOps,
3539 we use this special object to mark a possible TypeError,
3540 object which can be interpreted by pylint in order to emit a new warning.
3541 We are also exposing a new method for UnaryOps, called `type_errors`,
3542 which returns a list of UnaryOperationsError.
3543
3544 * A new method was added to the AST nodes, 'bool_value'. It is used to deduce
3545 the value of a node when used in a boolean context, which is useful
3546 for both inference, as well as for data flow analysis, where we are interested
3547 in what branches will be followed when the program will be executed.
3548 `bool_value` returns True, False or YES, if the node's boolean value can't
3549 be deduced. The method is used when inferring the unary operand `not`.
3550 Thus, `not something` will result in calling `something.bool_value` and
3551 negating the result, if it is a boolean.
3552
3553 * Add inference support for boolean operations (`and` and `not`).
3554
3555 * Add inference support for the builtin `callable`.
3556
3557 * astroid.inspector was moved to pylint.pyreverse, since
3558 it is the only known client of this module. No other change
3559 was made to the exported API.
3560
3561 * astroid.utils.ASTWalker and astroid.utils.LocalsVisitor
3562 were moved to pylint.pyreverse.utils.
3563
3564 * Add inference support for the builtin `bool`.
3565
3566 * Add `igetattr` method to scoped_nodes.Function.
3567
3568 * Add support for Python 3.5's MatMul operation: see PEP 465 for more
3569 details.
3570
3571 * NotImplemented is detected properly now as being part of the
3572 builtins module. Previously trying to infer the Name(NotImplemented)
3573 returned an YES object.
3574
3575 * Add astroid.helpers, a module of various useful utilities which don't
3576 belong yet into other components. Added *object_type*, a function
3577 which can be used to obtain the type of almost any astroid object,
3578 similar to how the builtin *type* works.
3579
3580 * Understand the one-argument form of the builtin *type*.
3581
3582 This uses the recently added *astroid.helpers.object_type* in order to
3583 retrieve the Python type of the first argument of the call.
3584
3585 * Add helpers.is_supertype and helpers.is_subtype, two functions for
3586 checking if an object is a super/sub type of another.
3587
3588 * Improve the inference of binary arithmetic operations (normal
3589 and augmented).
3590
3591 * Add support for retrieving TypeErrors for binary arithmetic operations.
3592
3593 The change is similar to what was added for UnaryOps: a new method
3594 called *type_errors* for both AugAssign and BinOp, which can be used
3595 to retrieve type errors occurred during inference. Also, a new
3596 exception object was added, BinaryOperationError.
3597
3598 * Lambdas found at class level, which have a `self` argument, are considered
3599 BoundMethods when accessing them from instances of their class.
3600
3601 * Add support for multiplication of tuples and lists with instances
3602 which provides an __index__ returning-int method.
3603
3604 * Add support for indexing containers with instances which provides
3605 an __index__ returning-int method.
3606
3607 * Star unpacking in assignments returns properly a list,
3608 not the individual components. Closes issue #138.
3609
3610 * Add annotation support for function.as_string(). Closes issue #37.
3611
3612 * Add support for indexing bytes on Python 3.
3613
3614 * Add support for inferring subscript on instances, which will
3615 use __getitem__. Closes issue #124.
3616
3617 * Add support for pkg_resources.declare_namespaces.
3618
3619 * Move pyreverse specific modules and functionality back into pyreverse
3620 (astroid.manager.Project, astroid.manager.Manager.project_from_files).
3621
3622 * Understand metaclasses added with six.add_metaclass decorator. Closes issue #129.
3623
3624 * Add a new convenience API, `astroid.parse`, which can be used to retrieve
3625 an astroid AST from a source code string, similar to how ast.parse can be
3626 used to obtain a Python AST from a source string. This is the test_utils.build_module
3627 promoted to a public API.
3628
3629 * do_import_module passes the proper relative_only flag if the level is higher
3630 than 1. This has the side effect that using `from .something import something`
3631 in a non-package will finally result in an import-error on Pylint's side.
3632 Until now relative_only was ignored, leading to the import of `something`,
3633 if it was globally available.
3634
3635 * Add get_wrapping_class API to scoped_nodes, which can be used to
3636 retrieve the class that wraps a node.
3637
3638 * Class.getattr looks by default in the implicit and the explicit metaclasses,
3639 which is `type` on Python 3.
3640
3641 Closes issue #114.
3642
3643 * There's a new separate step for transforms.
3644
3645 Until now, the transforms were applied at the same time the tree was
3646 being built. This was problematic if the transform functions were
3647 using inference, since the inference was executed on a partially
3648 constructed tree, which led to failures when post-building
3649 information was needed (such as setting the _from_names
3650 for the From imports).
3651 Now there's a separate step for transforms, which are applied
3652 using transform.TransformVisitor.
3653 There's a couple of other related changes:
3654
3655 * astroid.parse and AstroidBuilder gained a new parameter
3656 `apply_transforms`, which is a boolean flag, which will
3657 control if the transforms are applied. We do this because
3658 there are uses when the vanilla tree is wanted, without
3659 any implicit modification.
3660
3661 * the transforms are also applied for builtin modules,
3662 as a side effect of the fact that transform visiting
3663 was moved in AstroidBuilder._post_build from
3664 AstroidBuilder._data_build.
3665
3666 Closes issue #116.
3667
3668 * Class._explicit_metaclass is now a public API, in the form of
3669 Class.declared_metaclass.
3670
3671 Class.mro remains the de facto method for retrieving the metaclass
3672 of a class, which will also do an evaluation of what declared_metaclass
3673 returns.
3674
3675 * Understand slices of tuples, lists, strings and instances with support
3676 for slices.
3677
3678 Closes issue #137.
3679
3680 * Add proper grammatical names for `inferred` and `ass_type` methods,
3681 namely `inferred` and `assign_type`.
3682
3683 The old methods will raise PendingDeprecationWarning, being slated
3684 for removal in astroid 2.0.
3685
3686 * Add new AST names in order to be similar to the ones
3687 from the builtin ast module.
3688
3689 With this change, Getattr becomes Attributes, Backquote becomes
3690 Repr, Class is ClassDef, Function is FunctionDef, Discard is Expr,
3691 CallFunc is Call, From is ImportFrom, AssName is AssignName
3692 and AssAttr is AssignAttr. The old names are maintained for backwards
3693 compatibility and they are interchangeable, in the sense that using
3694 Discard will use Expr under the hood and the implemented visit_discard
3695 in checkers will be called with Expr nodes instead. The AST does not
3696 contain the old nodes, only the interoperability between them hides this
3697 fact. Recommendations to move to the new nodes are emitted accordingly,
3698 the old names will be removed in astroid 2.0.
3699
3700 * Add support for understanding class creation using `type.__new__(mcs, name, bases, attrs)``
3701
3702 Until now, inferring this kind of calls resulted in Instances, not in classes,
3703 since astroid didn't understand that the presence of the metaclass in the call
3704 leads to a class creating, not to an instance creation.
3705
3706 * Understand the `slice` builtin. Closes issue #184.
3707
3708 * Add brain tips for numpy.core, which should fix Pylint's #453.
3709
3710 * Add a new node, DictUnpack, which is used to represent the unpacking
3711 of a dictionary into another dictionary, using PEP 448 specific syntax
3712 ``({1:2, **{2:3})``
3713
3714 This is a different approach than what the builtin ast module does,
3715 since it just uses None to represent this kind of operation,
3716 which seems conceptually wrong, due to the fact the AST contains
3717 non-AST nodes. Closes issue #206.
3718
3719
3720
3721
3722 What's New in astroid 1.3.6?
3723 ============================
3724
3725 Release date: 2015-03-14
3726
3727
3728 * Class.slots raises NotImplementedError for old style classes.
3729 Closes issue #67.
3730
3731 * Add a new option to AstroidManager, `optimize_ast`, which
3732 controls if peephole optimizer should be enabled or not.
3733 This prevents a regression, where the visit_binop method
3734 wasn't called anymore with astroid 1.3.5, due to the differences
3735 in the resulting AST. Closes issue #82.
3736
3737
3738
3739 What's New in astroid 1.3.5?
3740 ============================
3741
3742 Release date: 2015-03-11
3743
3744
3745 * Add the ability to optimize small ast subtrees,
3746 with the first use in the optimization of multiple
3747 BinOp nodes. This removes recursivity in the rebuilder
3748 when dealing with a lot of small strings joined by the
3749 addition operator. Closes issue #59.
3750
3751 * Obtain the methods for the nose brain tip through an
3752 unittest.TestCase instance. Closes Pylint issue #457.
3753
3754 * Fix a crash which occurred when a class was the ancestor
3755 of itself. Closes issue #78.
3756
3757 * Improve the scope_lookup method for Classes regarding qualified
3758 objects, with an attribute name exactly as one provided in the
3759 class itself.
3760
3761 For example, a class containing an attribute 'first',
3762 which was also an import and which had, as a base, a qualified name
3763 or a Gettattr node, in the form 'module.first', then Pylint would
3764 have inferred the `first` name as the function from the Class,
3765 not the import. Closes Pylint issue #466.
3766
3767 * Implement the assigned_stmts operation for Starred nodes,
3768 which was omitted when support for Python 3 was added in astroid.
3769 Closes issue #36.
3770
3771
3772
3773 What's New in astroid 1.3.4?
3774 ============================
3775
3776 Release date: 2015-01-17
3777
3778
3779 * Get the first element from the method list when obtaining
3780 the functions from nose.tools.trivial. Closes Pylint issue #448.
3781
3782
3783 What's New in astroid 1.3.3?
3784 ============================
3785
3786 Release date: 2015-01-16
3787
3788
3789 * Restore file_stream to a property, but deprecate it in favour of
3790 the newly added method Module.stream. By using a method instead of a
3791 property, it will be easier to properly close the file right
3792 after it is used, which will ensure that no file descriptors are
3793 leaked. Until now, due to the fact that a module was cached,
3794 it was not possible to close the file_stream anywhere.
3795 file_stream will start emitting PendingDeprecationWarnings in
3796 astroid 1.4, DeprecationWarnings in astroid 1.5 and it will
3797 be finally removed in astroid 1.6.
3798
3799 * Add inference tips for 'tuple', 'list', 'dict' and 'set' builtins.
3800
3801 * Add brain definition for most string and unicode methods
3802
3803 * Changed the API for Class.slots. It returns None when the class
3804 doesn't define any slots. Previously, for both the cases where
3805 the class didn't have slots defined and when it had an empty list
3806 of slots, Class.slots returned an empty list.
3807
3808 * Add a new method to Class nodes, 'mro', for obtaining the
3809 the method resolution order of the class.
3810
3811 * Add brain tips for six.moves. Closes issue #63.
3812
3813 * Improve the detection for functions decorated with decorators
3814 which returns static or class methods.
3815
3816 * .slots() can contain unicode strings on Python 2.
3817
3818 * Add inference tips for nose.tools.
3819
3820
3821
3822 What's New in astroid 1.3.2?
3823 ============================
3824
3825 Release date: 2014-11-22
3826
3827
3828 * Fixed a crash with invalid subscript index.
3829
3830 * Implement proper base class semantics for Python 3, where
3831 every class derives from object.
3832
3833 * Allow more fine-grained control over C extension loading
3834 in the manager.
3835
3836
3837 What's New in astroid 1.3.1?
3838 ============================
3839
3840 Release date: 2014-11-21
3841
3842
3843 * Fixed a crash issue with the pytest brain module.
3844
3845
3846 What's New in astroid 1.3.0?
3847 ============================
3848
3849 Release date: 2014-11-20
3850
3851
3852 * Fix a maximum recursion error occurred during the inference,
3853 where statements with the same name weren't filtered properly.
3854 Closes pylint issue #295.
3855
3856 * Check that EmptyNode has an underlying object in
3857 EmptyNode.has_underlying_object.
3858
3859 * Simplify the understanding of enum members.
3860
3861 * Fix an infinite loop with decorator call chain inference,
3862 where the decorator returns itself. Closes issue #50.
3863
3864 * Various speed improvements. Patch by Alex Munroe.
3865
3866 * Add pytest brain plugin. Patch by Robbie Coomber.
3867
3868 * Support for Python versions < 2.7 has been dropped, and the
3869 source has been made compatible with Python 2 and 3. Running
3870 2to3 on installation for Python 3 is not needed anymore.
3871
3872 * astroid now depends on six.
3873
3874 * modutils._module_file opens __init__.py in binary mode.
3875 Closes issues #51 and #13.
3876
3877 * Only C extensions from trusted sources (the standard library)
3878 are loaded into the examining Python process to build an AST
3879 from the live module.
3880
3881 * Path names on case-insensitive filesystems are now properly
3882 handled. This fixes the stdlib detection code on Windows.
3883
3884 * Metaclass-generating functions like six.with_metaclass
3885 are now supported via some explicit detection code.
3886
3887 * astroid.register_module_extender has been added to generalize
3888 the support for module extenders as used by many brain plugins.
3889
3890 * brain plugins can now register hooks to handle failed imports,
3891 as done by the gobject-introspection plugin.
3892
3893 * The modules have been moved to a separate package directory,
3894 `setup.py develop` now works correctly.
3895
3896
3897
3898 What's New in astroid 1.2.1?
3899 ============================
3900
3901 Release date: 2014-08-24
3902
3903
3904 * Fix a crash occurred when inferring decorator call chain.
3905 Closes issue #42.
3906
3907 * Set the parent of vararg and kwarg nodes when inferring them.
3908 Closes issue #43.
3909
3910 * namedtuple inference knows about '_fields' attribute.
3911
3912 * enum members knows about the methods from the enum class.
3913
3914 * Name inference will lookup in the parent function
3915 of the current scope, in case searching in the current scope
3916 fails.
3917
3918 * Inference of the functional form of the enums takes into
3919 consideration the various inputs that enums accepts.
3920
3921 * The inference engine handles binary operations (add, mul etc.)
3922 between instances.
3923
3924 * Fix an infinite loop in the inference, by returning a copy
3925 of instance attributes, when calling 'instance_attr'.
3926 Closes issue #34 (patch by Emile Anclin).
3927
3928 * Don't crash when trying to infer unbound object.__new__ call.
3929 Closes issue #11.
3930
3931
3932 What's New in astroid 1.2.0?
3933 ============================
3934
3935 Release date: 2014-07-25
3936
3937
3938 * Function nodes can detect decorator call chain and see if they are
3939 decorated with builtin descriptors (`classmethod` and `staticmethod`).
3940
3941 * infer_call_result called on a subtype of the builtin type will now
3942 return a new `Class` rather than an `Instance`.
3943
3944 * `Class.metaclass()` now handles module-level __metaclass__ declaration
3945 on python 2, and no longer looks at the __metaclass__ class attribute on
3946 python 3.
3947
3948 * Function nodes can detect if they are decorated with subclasses
3949 of builtin descriptors when determining their type
3950 (`classmethod` and `staticmethod`).
3951
3952 * Add `slots` method to `Class` nodes, for retrieving
3953 the list of valid slots it defines.
3954
3955 * Expose function annotation to astroid: `Arguments` node
3956 exposes 'varargannotation', 'kwargannotation' and 'annotations'
3957 attributes, while `Function` node has the 'returns' attribute.
3958
3959 * Backported most of the logilab.common.modutils module there, as
3960 most things there are for pylint/astroid only and we want to be
3961 able to fix them without requiring a new logilab.common release
3962
3963 * Fix names grabbed using wildcard import in "absolute import mode"
3964 (ie with absolute_import activated from the __future__ or with
3965 python 3). Fix pylint issue #58.
3966
3967 * Add support in pylint-brain for understanding enum classes.
3968
3969
3970 What's New in astroid 1.1.1?
3971 ============================
3972
3973 Release date: 2014-04-30
3974
3975 * `Class.metaclass()` looks in ancestors when the current class
3976 does not define explicitly a metaclass.
3977
3978 * Do not cache modules if a module with the same qname is already
3979 known, and only return cached modules if both name and filepath
3980 match. Fixes pylint Bitbucket issue #136.
3981
3982
3983 What's New in astroid 1.1.0?
3984 ============================
3985
3986 Release date: 2014-04-18
3987
3988 * All class nodes are marked as new style classes for Py3k.
3989
3990 * Add a `metaclass` function to `Class` nodes to
3991 retrieve their metaclass.
3992
3993 * Add a new YieldFrom node.
3994
3995 * Add support for inferring arguments to namedtuple invocations.
3996
3997 * Make sure that objects returned for namedtuple
3998 inference have parents.
3999
4000 * Don't crash when inferring nodes from `with` clauses
4001 with multiple context managers. Closes #18.
4002
4003 * Don't crash when a class has some __call__ method that is not
4004 inferable. Closes #17.
4005
4006 * Unwrap instances found in `.ancestors()`, by using their _proxied
4007 class.
4008
4009
4010
4011
4012 What's New in astroid 1.0.1?
4013 ============================
4014
4015 Release date: 2013-10-18
4016
4017 * fix py3k/windows installation issue (issue #4)
4018
4019 * fix bug with namedtuple inference (issue #3)
4020
4021 * get back gobject introspection from pylint-brain
4022
4023 * fix some test failures under pypy and py3.3, though there is one remaining
4024 in each of these platform (2.7 tests are all green)
4025
4026
4027
4028
4029 What's New in astroid 1.0.0?
4030 =============================
4031
4032 Release date: 2013-07-29
4033
4034 * Fix some omissions in py2stdlib's version of hashlib and
4035 add a small test for it.
4036
4037 * Properly recognize methods annotated with abc.abstract{property,method}
4038 as abstract.
4039
4040 * Allow transformation functions on any node, providing a
4041 ``register_transform`` function on the manager instead of the
4042 ``register_transformer`` to make it more flexible wrt node selection
4043
4044 * Use the new transformation API to provide support for namedtuple
4045 (actually in pylint-brain, closes #8766)
4046
4047 * Added the test_utils module for building ASTs and
4048 extracting deeply nested nodes for easier testing.
4049
4050 * Add support for py3k's keyword only arguments (PEP 3102)
4051
4052 * RENAME THE PROJECT to astroid
4053
4054
4055
4056
4057 What's New in astroid 0.24.3?
4058 =============================
4059
4060 Release date: 2013-04-16
4061
4062 * #124360 [py3.3]: Don't crash on 'yield from' nodes
4063
4064 * #123062 [pylint-brain]: Use correct names for keywords for urlparse
4065
4066 * #123056 [pylint-brain]: Add missing methods for hashlib
4067
4068 * #123068: Fix inference for generator methods to correctly handle yields
4069 in lambdas.
4070
4071 * #123068: Make sure .as_string() returns valid code for yields in
4072 expressions.
4073
4074 * #47957: Set literals are now correctly treated as inference leaves.
4075
4076 * #123074: Add support for inference of subscript operations on dict
4077 literals.
4078
4079
4080
4081
4082 What's New in astroid 0.24.2?
4083 =============================
4084
4085 Release date: 2013-02-27
4086
4087 * pylint-brain: more subprocess.Popen faking (see #46273)
4088
4089 * #109562 [jython]: java modules have no __doc__, causing crash
4090
4091 * #120646 [py3]: fix for python3.3 _ast changes which may cause crash
4092
4093 * #109988 [py3]: test fixes
4094
4095
4096
4097
4098 What's New in astroid 0.24.1?
4099 =============================
4100
4101 Release date: 2012-10-05
4102
4103 * #106191: fix __future__ absolute import w/ From node
4104
4105 * #50395: fix function fromlineno when some decorator is splited on
4106 multiple lines (patch by Mark Gius)
4107
4108 * #92362: fix pyreverse crash on relative import
4109
4110 * #104041: fix crash 'module object has no file_encoding attribute'
4111
4112 * #4294 (pylint-brain): bad inference on mechanize.Browser.open
4113
4114 * #46273 (pylint-brain): bad inference subprocess.Popen.communicate
4115
4116
4117
4118
4119 What's New in astroid 0.24.0?
4120 =============================
4121
4122 Release date: 2012-07-18
4123
4124 * include pylint brain extension, describing some stuff not properly understood until then.
4125 (#100013, #53049, #23986, #72355)
4126
4127 * #99583: fix raw_building.object_build for pypy implementation
4128
4129 * use `open` rather than `file` in scoped_nodes as 2to3 miss it
4130
4131
4132
4133
4134 What's New in astroid 0.23.1?
4135 =============================
4136
4137 Release date: 2011-12-08
4138
4139 * #62295: avoid "OSError: Too many open files" by moving
4140 .file_stream as a Module property opening the file only when needed
4141
4142 * Lambda nodes should have a `name` attribute
4143
4144 * only call transformers if modname specified
4145
4146
4147
4148
4149 What's New in astroid 0.23.0?
4150 =============================
4151
4152 Release date: 2011-10-07
4153
4154 * #77187: ancestor() only returns the first class when inheriting
4155 from two classes coming from the same module
4156
4157 * #76159: putting module's parent directory on the path causes problems
4158 linting when file names clash
4159
4160 * #74746: should return empty module when __main__ is imported (patch by
4161 google)
4162
4163 * #74748: getitem protocol return constant value instead of a Const node
4164 (patch by google)
4165
4166 * #77188: support lgc.decorators.classproperty
4167
4168 * #77253: provide a way for user code to register astng "transformers"
4169 using manager.register_transformer(callable) where callable will be
4170 called after an astng has been built and given the related module node
4171 as argument
4172
4173
4174
4175
4176 What's New in astroid 0.22.0?
4177 =============================
4178
4179 Release date: 2011-07-18
4180
4181 * added column offset information on nodes (patch by fawce)
4182
4183 * #70497: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name'
4184
4185 * #70381: IndentationError in import causes crash
4186
4187 * #70565: absolute imports treated as relative (patch by Jacek Konieczny)
4188
4189 * #70494: fix file encoding detection with python2.x
4190
4191 * py3k: __builtin__ module renamed to builtins, we should consider this to properly
4192 build ast for builtin objects
4193
4194
4195
4196
4197 What's New in astroid 0.21.1?
4198 =============================
4199
4200 Release date: 2011-01-11
4201
4202 * python3: handle file encoding; fix a lot of tests
4203
4204 * fix #52006: "True" and "False" can be assigned as variable in Python2x
4205
4206 * fix #8847: pylint doesn't understand function attributes at all
4207
4208 * fix #8774: iterator / generator / next method
4209
4210 * fix bad building of ast from living object w/ container classes
4211 (eg dict, set, list, tuple): contained elements should be turned to
4212 ast as well (not doing it will much probably cause crash later)
4213
4214 * somewhat fix #57299 and other similar issue: Exception when
4215 trying to validate file using PyQt's PyQt4.QtCore module: we can't
4216 do much about it but at least catch such exception to avoid crash
4217
4218
4219
4220
4221 What's New in astroid 0.21.0?
4222 =============================
4223
4224 Release date: 2010-11-15
4225
4226 * python3.x: first python3.x release
4227
4228 * fix #37105: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name'
4229
4230 * python2.4: drop python < 2.5 support
4231
4232
4233
4234
4235 What's New in astroid 0.20.4?
4236 =============================
4237
4238 Release date: 2010-10-27
4239
4240 * fix #37868 #37665 #33638 #37909: import problems with absolute_import_activated
4241
4242 * fix #8969: false positive when importing from zip-safe eggs
4243
4244 * fix #46131: minimal class decorator support
4245
4246 * minimal python2.7 support (dict and set comprehension)
4247
4248 * important progress on Py3k compatibility
4249
4250
4251
4252
4253 What's New in astroid 0.20.3?
4254 =============================
4255
4256 Release date: 2010-09-28
4257
4258 * restored python 2.3 compatibility
4259
4260 * fix #45959: AttributeError: 'NoneType' object has no attribute 'frame', due
4261 to handling of __class__ when importing from living object (because of missing
4262 source code or C-compiled object)
4263
4264
4265
4266
4267 What's New in astroid 0.20.2?
4268 =============================
4269
4270 Release date: 2010-09-10
4271
4272 * fix astng building bug: we've to set module.package flag at the node
4273 creation time otherwise we'll miss this information when inferring relative
4274 import during the build process (this should fix for instance some problems
4275 with numpy)
4276
4277 * added __subclasses__ to special class attribute
4278
4279 * fix Class.interfaces so that no InferenceError raised on empty __implements__
4280
4281 * yield YES on multiplication of tuple/list with non valid operand
4282
4283
4284 What's New in astroid 0.20.1?
4285 =============================
4286
4287 Release date: 2010-05-11
4288
4289 * fix licensing to LGPL
4290
4291 * add ALL_NODES_CLASSES constant to nodes module
4292
4293 * nodes redirection cleanup (possible since refactoring)
4294
4295 * bug fix for python < 2.5: add Delete node on Subscript nodes if we are in a
4296 del context
4297
4298
4299 What's New in astroid 0.20.0?
4300 =============================
4301
4302 Release date: 2010-03-22
4303
4304 * fix #20464: raises ?TypeError: '_Yes' object is not iterable? on list inference
4305
4306 * fix #19882: pylint hangs
4307
4308 * fix #20759: crash on pyreverse UNARY_OP_METHOD KeyError '~'
4309
4310 * fix #20760: crash on pyreverse : AttributeError: 'Subscript'
4311 object has no attribute 'infer_lhs'
4312
4313 * fix #21980: [Python-modules-team] Bug#573229 : Pylint hangs;
4314 improving the cache yields a speed improvement on big projects
4315
4316 * major refactoring: rebuild the tree instead of modify / monkey patching
4317
4318 * fix #19641: "maximum recursion depth exceeded" messages w/ python 2.6
4319 this was introduced by a refactoring
4320
4321 * Ned Batchelder patch to properly import eggs with Windows line
4322 endings. This fixes a problem with pylint not being able to
4323 import setuptools.
4324
4325 * Winfried Plapper patches fixing .op attribute value for AugAssign nodes,
4326 visit_ifexp in nodes_as_string
4327
4328 * Edward K. Ream / Tom Fleck patch closes #19641 (maximum recursion depth
4329 exceeded" messages w/ python 2.6), see https://bugs.launchpad.net/pylint/+bug/456870
4330
4331
4332
4333
4334 What's New in astroid 0.19.3?
4335 =============================
4336
4337 Release date: 2009-12-18
4338
4339 * fix name error making 0.19.2 almost useless
4340
4341
4342
4343
4344 What's New in astroid 0.19.2?
4345 =============================
4346
4347 Release date: 2009-12-18
4348
4349 * fix #18773: inference bug on class member (due to bad handling of instance
4350 / class nodes "bounded" to method calls)
4351
4352 * fix #9515: strange message for non-class "Class baz has no egg member" (due to
4353 bad inference of function call)
4354
4355 * fix #18953: inference fails with augmented assignment (special case for augmented
4356 assignment in infer_ass method)
4357
4358 * fix #13944: false positive for class/instance attributes (Instance.getattr
4359 should return assign nodes on instance classes as well as instance.
4360
4361 * include spelling fixes provided by Dotan Barak
4362
4363
4364
4365
4366 What's New in astroid 0.19.1?
4367 =============================
4368
4369 Release date: 2009-08-27
4370
4371 * fix #8771: crash on yield expression
4372
4373 * fix #10024: line numbering bug with try/except/finally
4374
4375 * fix #10020: when building from living object, __name__ may be None
4376
4377 * fix #9891: help(logilab.astng) throws TypeError
4378
4379 * fix #9588: false positive E1101 for augmented assignment
4380
4381
4382
4383
4384 What's New in astroid 0.19.0?
4385 =============================
4386
4387 Release date: 2009-03-25
4388
4389 * fixed python 2.6 issue (tests ok w/ 2.4, 2.5, 2.6. Anyone using 2.2 / 2.3
4390 to tell us if it works?)
4391
4392 * some understanding of the __builtin__.property decorator
4393
4394 * inference: introduce UnboundMethod / rename InstanceMethod to BoundMethod
4395
4396
4397
4398
4399 What's New in astroid 0.18.0?
4400 =============================
4401
4402 Release date: 2009-03-19
4403
4404 * major api / tree structure changes to make it works with compiler *and*
4405 python >= 2.5 _ast module
4406
4407 * cleanup and refactoring on the way
4408
4409
4410
4411
4412 What's New in astroid 0.17.4?
4413 =============================
4414
4415 Release date: 2008-11-19
4416
4417 * fix #6015: filter statements bug triggering W0631 false positive in pylint
4418
4419 * fix #5571: Function.is_method() should return False on module level
4420 functions decorated by staticmethod/classmethod (avoid some crash in pylint)
4421
4422 * fix #5010: understand python 2.5 explicit relative imports
4423
4424
4425
4426
4427 What's New in astroid 0.17.3?
4428 =============================
4429
4430 Release date: 2008-09-10
4431
4432 * fix #5889: astng crash on certain pyreverse projects
4433
4434 * fix bug w/ loop assignment in .lookup
4435
4436 * apply Maarten patch fixing a crash on TryFinalaly.block_range and fixing
4437 'else'/'final' block line detection
4438
4439
4440
4441
4442 What's New in astroid 0.17.2?
4443 =============================
4444
4445 Release date: 2008-01-14
4446
4447 * "with" statement support, patch provided by Brian Hawthorne
4448
4449 * fixed recursion arguments in nodes_of_class method as notified by
4450 Dave Borowitz
4451
4452 * new InstanceMethod node introduced to wrap bound method (e.g. Function
4453 node), patch provided by Dave Borowitz
4454
4455
4456
4457
4458 What's New in astroid 0.17.1?
4459 =============================
4460
4461 Release date: 2007-06-07
4462
4463 * fix #3651: crash when callable as default arg
4464
4465 * fix #3670: subscription inference crash in some cases
4466
4467 * fix #3673: Lambda instance has no attribute 'pytype'
4468
4469 * fix crash with chained "import as"
4470
4471 * fix crash on numpy
4472
4473 * fix potential InfiniteRecursion error with builtin objects
4474
4475 * include patch from Marien Zwart fixing some test / py 2.5
4476
4477 * be more error resilient when accessing living objects from external
4478 code in the manager
4479
4480
4481
4482
4483 What's New in astroid 0.17.0?
4484 =============================
4485
4486 Release date: 2007-02-22
4487
4488 * api change to be able to infer using a context (used to infer function call
4489 result only for now)
4490
4491 * slightly better inference on astng built from living object by trying to infer
4492 dummy nodes (able to infer 'help' builtin for instance)
4493
4494 * external attribute definition support
4495
4496 * basic math operation inference
4497
4498 * new pytype method on possibly inferred node (e.g. module, classes, const...)
4499
4500 * fix a living object astng building bug, which was making "open" uninferable
4501
4502 * fix lookup of name in method bug (#3289)
4503
4504 * fix decorator lookup bug (#3261)
4505
4506
4507
4508
4509 What's New in astroid 0.16.3?
4510 =============================
4511
4512 Release date: 2006-11-23
4513
4514 * enhance inference for the subscription notation (motivated by a patch from Amaury)
4515 and for unary sub/add
4516
4517
4518
4519
4520 What's New in astroid 0.16.2?
4521 =============================
4522
4523 Release date: 2006-11-15
4524
4525 * grrr, fixed python 2.3 incompatibility introduced by generator expression
4526 scope handling
4527
4528 * upgrade to avoid warnings with logilab-common 0.21.0 (on which now
4529 depends so)
4530
4531 * backported astutils module from logilab-common
4532
4533
4534
4535
4536 What's New in astroid 0.16.1?
4537 =============================
4538
4539 Release date: 2006-09-25
4540
4541 * python 2.5 support, patch provided by Marien Zwart
4542
4543 * fix [Class|Module].block_range method (this fixes pylint's inline
4544 disabling of messages on classes/modules)
4545
4546 * handle class.__bases__ and class.__mro__ (proper metaclass handling
4547 still needed though)
4548
4549 * drop python2.2 support: remove code that was working around python2.2
4550
4551 * fixed generator expression scope bug
4552
4553 * patch transformer to extract correct line information
4554
4555
4556
4557
4558 What's New in astroid 0.16.0?
4559 =============================
4560
4561 Release date: 2006-04-19
4562
4563 * fix living object building to consider classes such as property as
4564 a class instead of a data descriptor
4565
4566 * fix multiple assignment inference which was discarding some solutions
4567
4568 * added some line manipulation methods to handle pylint's block messages
4569 control feature (Node.last_source_line(), None.block_range(lineno)
4570
4571
4572
4573
4574 What's New in astroid 0.15.1?
4575 =============================
4576
4577 Release date: 2006-03-10
4578
4579 * fix avoiding to load everything from living objects... Thanks Amaury!
4580
4581 * fix a possible NameError in Instance.infer_call_result
4582
4583
4584
4585
4586 What's New in astroid 0.15.0?
4587 =============================
4588
4589 Release date: 2006-03-06
4590
4591 * fix possible infinite recursion on global statements (close #10342)
4592 and in various other cases...
4593
4594 * fix locals/globals interactions when the global statement is used
4595 (close #10434)
4596
4597 * multiple inference related bug fixes
4598
4599 * associate List, Tuple and Dict and Const nodes to their respective
4600 classes
4601
4602 * new .ass_type method on assignment related node, returning the
4603 assignment type node (Assign, For, ListCompFor, GenExprFor,
4604 TryExcept)
4605
4606 * more API refactoring... .resolve method has disappeared, now you
4607 have .ilookup on every nodes and .getattr/.igetattr on node
4608 supporting the attribute protocol
4609
4610 * introduced a YES object that may be returned when there is ambiguity
4611 on an inference path (typically function call when we don't know
4612 arguments value)
4613
4614 * builder try to instantiate builtin exceptions subclasses to get their
4615 instance attribute
4616
4617
4618
4619
4620 What's New in astroid 0.14.0?
4621 =============================
4622
4623 Release date: 2006-01-10
4624
4625 * some major inference improvements and refactoring ! The drawback is
4626 the introduction of some non backward compatible change in the API
4627 but it's imho much cleaner and powerful now :)
4628
4629 * new boolean property .newstyle on Class nodes (implements #10073)
4630
4631 * new .import_module method on Module node to help in .resolve
4632 refactoring
4633
4634 * .instance_attrs has list of assignments to instance attribute
4635 dictionary as value instead of one
4636
4637 * added missing GenExprIf and GenExprInner nodes, and implements
4638 as_string for each generator expression related nodes
4639
4640 * specifically catch KeyboardInterrupt to reraise it in some places
4641
4642 * fix so that module names are always absolute
4643
4644 * fix .resolve on package where a subpackage is imported in the
4645 __init__ file
4646
4647 * fix a bug regarding construction of Function node from living object
4648 with earlier version of python 2.4
4649
4650 * fix a NameError on Import and From self_resolve method
4651
4652 * fix a bug occurring when building an astng from a living object with
4653 a property
4654
4655 * lint fixes
4656
4657
4658
4659
4660 What's New in astroid 0.13.1?
4661 =============================
4662
4663 Release date: 2005-11-07
4664
4665 * fix bug on building from living module the same object in
4666 encountered more than once time (e.g. builtins.object) (close #10069)
4667
4668 * fix bug in Class.ancestors() regarding inner classes (close #10072)
4669
4670 * fix .self_resolve() on From and Module nodes to handle package
4671 precedence over module (close #10066)
4672
4673 * locals dict for package contains __path__ definition (close #10065)
4674
4675 * astng provide GenExpr and GenExprFor nodes with python >= 2.4
4676 (close #10063)
4677
4678 * fix python2.2 compatibility (close #9922)
4679
4680 * link .__contains__ to .has_key on scoped node to speed up execution
4681
4682 * remove no more necessary .module_object() method on From and Module
4683 nodes
4684
4685 * normalize parser.ParserError to SyntaxError with python 2.2
4686
4687
4688
4689
4690 What's New in astroid 0.13.0?
4691 =============================
4692
4693 Release date: 2005-10-21
4694
4695 * .locals and .globals on scoped node handle now a list of references
4696 to each assignment statements instead of a single reference to the
4697 first assignment statement.
4698
4699 * fix bug with manager.astng_from_module_name when a context file is
4700 given (notably fix ZODB 3.4 crash with pylint/pyreverse)
4701
4702 * fix Compare.as_string method
4703
4704 * fix bug with lambda object missing the "type" attribute
4705
4706 * some minor refactoring
4707
4708 * This package has been extracted from the logilab-common package, which
4709 will be kept for some time for backward compatibility but will no
4710 longer be maintained (this explains that this package is starting with
4711 the 0.13 version number, since the fork occurs with the version
4712 released in logilab-common 0.12).