Debian Codegraph @

ChangeLog

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