NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #556 most downloaded on PyPI
An abstract syntax tree for Python with inference support.
Last release 4 days ago
25 Sep 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
13 years old
192 releases · first in 2013
Support more possible usages of attrs decorators.
Support more possible usages of attrs decorators.
Closes pylint-dev/pylint#7884
Release date: 2023-04-03
Support more possible usages of attrs decorators.
Closes pylint-dev/pylint#7884
Restore behavior of setting a Call as a base for classes created using six.with_metaclass(), and harden support for using enums as metaclasses in this
Restore behavior of setting a Call as a base for classes created using six.with_metaclass(),
and harden support for using enums as metaclasses in this case.
Reverts #1622 Refs PyCQA/pylint#5935 Refs PyCQA/pylint#7506
One column per quarter.
Release date: 2023-03-26
Restore behavior of setting a Call as a base for classes created using six.with_metaclass(),
and harden support for using enums as metaclasses in this case.
Reverts #1622 Refs pylint-dev/pylint#5935 Refs pylint-dev/pylint#7506
Deprecate modutils.is_standard_module(). It will be removed in the next minor release. Functionality has been replaced by two new functions, modutils.…
astroid now supports TryStar nodes from python 3.11 and should be fully compatible with python 3.11.
Closes #2028
Formattedvalue.postinit is now keyword only. This is to allow correct typing of the
Formattedvalue class.
Refs #1516
Astroid now supports custom import hooks.
Refs PyCQA/pylint#7306
astroid now infers return values from match cases.
Refs PyCQA/pylint#5288
AstroidManager.clear_cache now also clears the inference context cache.
Refs #1780
Astroid now retrieves the default values of keyword only arguments and sets them on
Arguments.kw_defaults.
Uninferable now has the type UninferableBase. This is to facilitate correctly type annotating
code that uses this singleton.
Closes #1680
Deprecate modutils.is_standard_module(). It will be removed in the next minor release.
Functionality has been replaced by two new functions,
modutils.is_stdlib_module() and modutils.module_in_path().
Closes #2012
Fix are_exclusive function when a walrus operator is used inside IfExp.test field.
Closes #2022
Release date: 2023-03-06
astroid now supports TryStar nodes from python 3.11 and should be fully compatible with python 3.11.
Closes #2028
Formattedvalue.postinit is now keyword only. This is to allow correct typing of the
Formattedvalue class.
Refs #1516
Astroid now supports custom import hooks.
Refs pylint-dev/pylint#7306
astroid now infers return values from match cases.
Refs pylint-dev/pylint#5288
AstroidManager.clear_cache now also clears the inference context cache.
Refs #1780
max_inferable_values can now be set on AstroidManager instances, e.g. astroid.MANAGER
besides just the AstroidManager class itself.
Closes #2280
Astroid now retrieves the default values of keyword only arguments and sets them on
Arguments.kw_defaults.
Uninferable now has the type UninferableBase. This is to facilitate correctly type annotating
code that uses this singleton.
Closes #1680
Deprecate modutils.is_standard_module(). It will be removed in the next minor release.
Functionality has been replaced by two new functions,
modutils.is_stdlib_module() and modutils.module_in_path().
Closes #2012
Fix are_exclusive function when a walrus operator is used inside IfExp.test field.
Closes #2022
'_infer_str_format_call' won't crash anymore when the string it analyses are uninferable.
'_infer_str_format_call' won't crash anymore when the string it analyses are uninferable.
Closes PyCQA/pylint#8109
Release date: 2023-02-12
'_infer_str_format_call' won't crash anymore when the string it analyses are uninferable.
Closes pylint-dev/pylint#8109
Revert CallContext change as it caused a RecursionError regression.
CallContext change as it caused a RecursionError regression.Release date: 2023-01-31
CallContext change as it caused a RecursionError regression.Add support for inferring binary union types added in Python 3.10. Refs PyCQA/pylint#8119
Release date: 2023-01-31
Add support for inferring binary union types added in Python 3.10.
Refs pylint-dev/pylint#8119
Capture and log messages emitted when inspecting a module for astroid.
Closes #1904
Revert CallContext change as it caused a RecursionError regression.
CallContext change as it caused a RecursionError regression.Release date: 2023-01-31
CallContext change as it caused a RecursionError regression.Fix issues with typing_extensions.TypeVar.
typing_extensions.TypeVar.ClassDef.fromlino for PyPy 3.8 (v7.3.11) if class is wrapped by a decorator.Lock to the multiprocessing brain.
Closes PyCQA/pylint#3313Release date: 2023-01-31
Fix issues with typing_extensions.TypeVar.
Fix ClassDef.fromlino for PyPy 3.8 (v7.3.11) if class is wrapped by a decorator.
Preserve parent CallContext when inferring nested functions.
Closes pylint-dev/pylint#8074
Add Lock to the multiprocessing brain.
Closes pylint-dev/pylint#3313
Fix a regression in 2.13.2 where a RunTimeError could be raised unexpectedly.
Fix a regression in 2.13.2 where a RunTimeError could be raised unexpectedly.
Closes #1958
Fix overwritten attributes in inherited dataclasses not being ordered correctly.
Closes PyCQA/pylint#7881
Fix a false positive when an attribute named Enum was confused with enum.Enum.
Calls to Enum are now inferred & the qualified name is checked.
Refs PyCQA/pylint#5719
Release date: 2023-01-20
Fix a regression in 2.13.2 where a RunTimeError could be raised unexpectedly.
Closes #1958
Fix overwritten attributes in inherited dataclasses not being ordered correctly.
Closes pylint-dev/pylint#7881
Fix a false positive when an attribute named Enum was confused with enum.Enum.
Calls to Enum are now inferred & the qualified name is checked.
Refs pylint-dev/pylint#5719
Remove unnecessary typing_extensions dependency on Python 3.11 and newer
Removed version conditions on typing_extensions dependency. Removed typing_extensions from our tests requirements as it was preventing issues to appea
Removed version conditions on typing_extensions dependency. Removed typing_extensions from our tests requirements as it was preventing issues to appear in our continuous integration.
Closes #1945
Release date: 2023-01-08
Removed version conditions on typing_extensions dependency. Removed typing_extensions from our tests requirements as it was preventing issues to appear in our continuous integration.
Closes #1945
Bumping typing_extensions to 4.0.0 that is required when using Self
Bumping typing_extensions to 4.0.0 that is required when using Self
Closes #1942
Release date: 2023-01-08
Bumping typing_extensions to 4.0.0 that is required when using Self
Closes #1942
Fixed importing of modules that have the same name as the file that is importing. astroid will now correctly handle an import math statement in a file
Fixed importing of modules that have the same name as the file that is importing.
astroid will now correctly handle an import math statement in a file called math.py
by relying on the import system.
Refs PyCQA/pylint#5151
Create ContextManagerModel and let GeneratorModel inherit from it.
Refs PyCQA/pylint#2567
Added a regex brain.
Refs PyCQA/pylint#1911
Support "is None" constraints from if statements during inference.
Refs #791 Refs PyCQA/pylint#157 Refs PyCQA/pylint#1472 Refs PyCQA/pylint#2016 Refs PyCQA/pylint#2631 Refs PyCQA/pylint#2880
Release date: 2023-01-07
Fixed importing of modules that have the same name as the file that is importing.
astroid will now correctly handle an import math statement in a file called math.py
by relying on the import system.
Refs pylint-dev/pylint#5151
Create ContextManagerModel and let GeneratorModel inherit from it.
Refs pylint-dev/pylint#2567
Added a regex brain.
Refs pylint-dev/pylint#1911
Support "is None" constraints from if statements during inference.
Ref #791 Ref pylint-dev/pylint#157 Ref pylint-dev/pylint#1472 Ref pylint-dev/pylint#2016 Ref pylint-dev/pylint#2631 Ref pylint-dev/pylint#2880
Handle the effect of properties on the __init__ of a dataclass correctly.
Handle the effect of properties on the __init__ of a dataclass correctly.
Closes PyCQA/pylint#5225
Handle the effect of kw_only=True in dataclass fields correctly.
Closes PyCQA/pylint#7623
Handle the effect of init=False in dataclass fields correctly.
Closes PyCQA/pylint#7291
Fix crash if numpy module doesn't have version attribute.
Refs PyCQA/pylint#7868
Handle AttributeError during str.format template inference tip evaluation
Closes PyCQA/pylint#1902
Release date: 2023-01-06
Handle the effect of properties on the __init__ of a dataclass correctly.
Closes pylint-dev/pylint#5225
Handle the effect of kw_only=True in dataclass fields correctly.
Closes pylint-dev/pylint#7623
Handle the effect of init=False in dataclass fields correctly.
Closes pylint-dev/pylint#7291
Fix crash if numpy module doesn't have version attribute.
Refs pylint-dev/pylint#7868
Handle AttributeError during str.format template inference tip evaluation
Closes pylint-dev/pylint#1902
Add the masked_invalid function in the numpy.ma brain.
Closes pylint-dev/pylint#5715
Prevent returning an empty list for ClassDef.slots() when the mro list contains one class & it is not object.
Prevent returning an empty list for ClassDef.slots() when the mro list contains one class & it is not object.
Refs PyCQA/pylint#5099
Prevent a crash when inferring calls to str.format with inferred arguments
that would be invalid.
Closes #1856
Infer the length argument of the random.sample function.
Refs PyCQA/pylint#7706
Catch ValueError when indexing some builtin containers and sequences during inference.
Closes #1843
Release date: 2022-11-19
Prevent returning an empty list for ClassDef.slots() when the mro list contains one class & it is not object.
Refs pylint-dev/pylint#5099
Prevent a crash when inferring calls to str.format with inferred arguments
that would be invalid.
Closes #1856
Infer the length argument of the random.sample function.
Refs pylint-dev/pylint#7706
Catch ValueError when indexing some builtin containers and sequences during inference.
Closes #1843
Add the length parameter to hash.digest & hash.hexdigest in the hashlib brain.
Add the length parameter to hash.digest & hash.hexdigest in the hashlib brain.
Refs PyCQA/pylint#4039
Prevent a crash when a module's __path__ attribute is unexpectedly missing.
Refs PyCQA/pylint#7592
Fix inferring attributes with empty annotation assignments if parent class contains valid assignment.
Refs PyCQA/pylint#7631
Release date: 2022-10-19
Add the length parameter to hash.digest & hash.hexdigest in the hashlib brain.
Refs pylint-dev/pylint#4039
Prevent a crash when a module's __path__ attribute is unexpectedly missing.
Refs pylint-dev/pylint#7592
Fix inferring attributes with empty annotation assignments if parent class contains valid assignment.
Refs pylint-dev/pylint#7631
Improve detection of namespace packages for the modules with __spec__ set to None.
Improve detection of namespace packages for the modules with __spec__ set to None.
Closes PyCQA/pylint#7488.
Fixed a regression in the creation of the __init__ of dataclasses with
multiple inheritance.
Closes PyCQA/pylint#7434
Release date: 2022-10-10
Add _value2member_map_ member to the enum brain.
Refs pylint-dev/pylint#3941
Improve detection of namespace packages for the modules with __spec__ set to None.
Closes pylint-dev/pylint#7488.
Fixed a regression in the creation of the __init__ of dataclasses with
multiple inheritance.
Closes pylint-dev/pylint#7434
Fixed a crash when introspecting modules compiled by cffi.
Fixed a crash when introspecting modules compiled by cffi.
Closes #1776 Closes PyCQA/pylint#7399
decorators.cached now gets its cache cleared by calling AstroidManager.clear_cache.
Refs #1780
Release date: 2022-09-17
Fixed a crash when introspecting modules compiled by cffi.
Closes #1776 Closes pylint-dev/pylint#7399
decorators.cached now gets its cache cleared by calling AstroidManager.clear_cache.
Refs #1780
Fixed creation of the __init__ of dataclassess with multiple inheritance.
Fixed creation of the __init__ of dataclassess with multiple inheritance.
Closes PyCQA/pylint#7427
Fixed a crash on namedtuples that use typename to specify their name.
Closes PyCQA/pylint#7429
Release date: 2022-09-07
Fixed creation of the __init__ of dataclassess with multiple inheritance.
Closes pylint-dev/pylint#7427
Fixed a crash on namedtuples that use typename to specify their name.
Closes pylint-dev/pylint#7429
Fixed a crash in the dataclass brain for InitVars without subscript typing.
Fixed a crash in the dataclass brain for InitVars without subscript typing.
Closes PyCQA/pylint#7422
Fixed parsing of default values in dataclass attributes.
Closes PyCQA/pylint#7425
Release date: 2022-09-06
Fixed a crash in the dataclass brain for InitVars without subscript typing.
Closes pylint-dev/pylint#7422
Fixed parsing of default values in dataclass attributes.
Closes pylint-dev/pylint#7425
Fixed a crash in the dataclass brain for uninferable bases.
Fixed a crash in the dataclass brain for uninferable bases.
Closes PyCQA/pylint#7418
Release date: 2022-09-06
Fixed a crash in the dataclass brain for uninferable bases.
Closes pylint-dev/pylint#7418
Fix a crash involving Uninferable arguments to namedtuple().
Fix a crash involving Uninferable arguments to namedtuple().
Closes PyCQA/pylint#7375
The dataclass brain now understands the kw_only keyword in dataclass decorators.
Closes PyCQA/pylint#7290
Release date: 2022-09-05
Fix a crash involving Uninferable arguments to namedtuple().
Closes pylint-dev/pylint#7375
The dataclass brain now understands the kw_only keyword in dataclass decorators.
Closes pylint-dev/pylint#7290
Prevent first-party imports from being resolved to site-packages.
Prevent first-party imports from being resolved to site-packages.
Refs PyCQA/pylint#7365
Fix astroid.interpreter._import.util.is_namespace() incorrectly
returning True for frozen stdlib modules on PyPy.
Closes #1755
Release date: 2022-08-29
Prevent first-party imports from being resolved to site-packages.
Refs pylint-dev/pylint#7365
Fix astroid.interpreter._import.util.is_namespace() incorrectly
returning True for frozen stdlib modules on PyPy.
Closes #1755
Fixed a crash involving non-standard type comments such as # type: # any comment.
Fixed a crash involving non-standard type comments such as # type: # any comment.
Refs PyCQA/pylint#7347
Release date: 2022-08-25
Fixed a crash involving non-standard type comments such as # type: # any comment.
Refs pylint-dev/pylint#7347
Fixed crash in ExplicitNamespacePackageFinder involving _SixMetaPathImporter.
Fixed crash in ExplicitNamespacePackageFinder involving _SixMetaPathImporter.
Closes #1708
Fix unhandled FutureWarning from pandas import in cython modules
Closes #1717
Fix false positive with inference of type-annotated Enum classes.
Refs PyCQA/pylint#7265
Fix crash with inference of type-annotated Enum classes where the member has no value.
Fix a crash inferring invalid old-style string formatting with %.
Closes #1737
Fix false positive with inference of http module when iterating HTTPStatus.
Refs PyCQA/pylint#7307
Bumped minimum requirement of wrapt to 1.14 on Python 3.11.
Don't add dataclass fields annotated with KW_ONLY to the list of fields.
Refs PyCQA/pylint#5767
Release date: 2022-08-23
Fixed crash in ExplicitNamespacePackageFinder involving _SixMetaPathImporter.
Closes #1708
Fix unhandled FutureWarning from pandas import in cython modules
Closes #1717
Fix false positive with inference of type-annotated Enum classes.
Refs pylint-dev/pylint#7265
Fix crash with inference of type-annotated Enum classes where the member has no value.
Fix a crash inferring invalid old-style string formatting with %.
Closes #1737
Fix false positive with inference of http module when iterating HTTPStatus.
Refs pylint-dev/pylint#7307
Bumped minimum requirement of wrapt to 1.14 on Python 3.11.
Don't add dataclass fields annotated with KW_ONLY to the list of fields.
Refs pylint-dev/pylint#5767
Fixed crash in modulo operations for divisions by zero.
Fixed crash in modulo operations for divisions by zero.
Closes #1700
Fixed crash with recursion limits during inference.
Closes #1646
Release date: 2022-07-12
Fixed crash in modulo operations for divisions by zero.
Closes #1700
Fixed crash with recursion limits during inference.
Closes #1646
Fix a crash when inferring old-style string formatting (%) using tuples.
Fix a crash when inferring old-style string formatting (%) using tuples.
Fix a crash when None (or a value inferred as None) participates in a
** expression.
Fix a crash involving properties within if blocks.
Release date: 2022-07-10
Fix a crash when inferring old-style string formatting (%) using tuples.
Fix a crash when None (or a value inferred as None) participates in a
** expression.
Fix a crash involving properties within if blocks.
The astroid.mixins module has been deprecated and marked for removal in 3.0.0.
Fix signal has no connect member for PySide2 5.15.2+ and PySide6
Closes #4040, #5378
astroid now requires Python 3.7.2 to run.
Avoid setting a Call as a base for classes created using six.with_metaclass().
Refs PyCQA/pylint#5935
Fix detection of builtins on PyPy 3.9.
Fix re brain on Python 3.11. The flags now come from re._compile.
Build nodes.Module for frozen modules which have location information in their
ModuleSpec.
Closes #1512
The astroid.mixins module has been deprecated and marked for removal in 3.0.0.
Closes #1633
Capture and log messages emitted by C extensions when importing them. This prevents contaminating programmatic output, e.g. pylint's JSON reporter.
Closes PyCQA/pylint#3518
Calls to str.format are now correctly inferred.
Closes #104, Closes #1611
__new__ and __init__ have been added to the ObjectModel and are now
inferred as BoundMethods.
Old style string formatting (using % operators) is now correctly inferred.
Closes #151
Adds missing enums from ssl module.
Closes PyCQA/pylint#3691
Remove dependency on pkg_resources from setuptools.
Closes #1103
Allowed AstroidManager.clear_cache to reload necessary brain plugins.
Fixed incorrect inferences after rebuilding the builtins module, e.g. by calling
AstroidManager.clear_cache.
Closes #1559
On Python versions >= 3.9, astroid now understands subscripting
builtin classes such as enumerate or staticmethod.
Fixed inference of Enums when they are imported under an alias.
Closes PyCQA/pylint#5776
Rename ModuleSpec -> module_type constructor parameter to match attribute
name and improve typing. Use type instead.
ObjectModel and ClassModel now know about their __new__ and __call__ attributes.
Fixed pylint not-callable false positive with nested-tuple assignment in a for-loop.
Refs PyCQA/pylint#5113
Instances of builtins created with __new__(cls, value) are now inferred.
Infer the return value of the .copy() method on dict, list, set,
and frozenset.
Closes #1403
Fixed inference of elements of living container objects such as tuples and sets in the
sys and ssl modules.
Add pathlib brain to handle pathlib.PurePath.parents inference.
Closes PyCQA/pylint#5783
Avoid inferring the results of ** operations involving values greater than 1e5
to avoid expensive computation.
Closes PyCQA/pylint#6745
Fix test for Python 3.11. In some instances err.__traceback__ will
be uninferable now.
Add brain for numpy core module einsumfunc.
Closes PyCQA/pylint#5821
Infer the DictUnpack value for Dict.getitem calls.
Closes #1195
Fix a crash involving properties within try ... except blocks.
Closes PyCQA/pylint#6592
Prevent creating Instance objects that proxy other Instances when there is
ambiguity (or user error) in calling __new__(cls).
Refs PyCQA/pylint#7109
Added support for usedforsecurity keyword to hashlib constructors.
Added support for usedforsecurity keyword to hashlib constructors.
Closes PyCQA/pylint#6017
Updated the stdlib brain for subprocess.Popen to accommodate Python 3.9+.
Closes PyCQA/pylint#7092
Release date: 2022-07-09
Added support for usedforsecurity keyword to hashlib constructors.
Closes pylint-dev/pylint#6017
Updated the stdlib brain for subprocess.Popen to accommodate Python 3.9+.
Closes pylint-dev/pylint#7092
The Qt brain now correctly treats calling .disconnect() (with no arguments) on a slot as valid.
The Qt brain now correctly treats calling .disconnect() (with no
arguments) on a slot as valid.
The argparse brain no longer incorrectly adds "Namespace" to the locals
of functions that return an argparse.Namespace object.
Refs PyCQA/pylint#6895
Release date: 2022-06-13
The Qt brain now correctly treats calling .disconnect() (with no
arguments) on a slot as valid.
The argparse brain no longer incorrectly adds "Namespace" to the locals
of functions that return an argparse.Namespace object.
Refs pylint-dev/pylint#6895
Fix crash while obtaining object_type() of an Unknown node.
Fix crash while obtaining object_type() of an Unknown node.
Refs PyCQA/pylint#6539
Fix a bug where in attempting to handle the patching of distutils by virtualenv,
library submodules called distutils (e.g. numpy.distutils) were included also.
Refs PyCQA/pylint#6497
Release date: 2022-05-09
Fix crash while obtaining object_type() of an Unknown node.
Refs pylint-dev/pylint#6539
Fix a bug where in attempting to handle the patching of distutils by virtualenv,
library submodules called distutils (e.g. numpy.distutils) were included also.
Refs pylint-dev/pylint#6497
Fix col_offset attribute for nodes involving with on PyPy.
Fix col_offset attribute for nodes involving with on PyPy.
Fixed a crash involving two starred expressions: one inside a comprehension, both inside a call.
Refs PyCQA/pylint#6372
Made FunctionDef.implicit_parameters return 1 for methods by making
FunctionDef.is_bound return True, as it does for class methods.
Closes PyCQA/pylint#6464
Fixed a crash when _filter_stmts encounters an EmptyNode.
Closes PyCQA/pylint#6438
Release date: 2022-05-02
Fix col_offset attribute for nodes involving with on PyPy.
Fixed a crash involving two starred expressions: one inside a comprehension, both inside a call.
Refs pylint-dev/pylint#6372
Made FunctionDef.implicit_parameters return 1 for methods by making
FunctionDef.is_bound return True, as it does for class methods.
Closes pylint-dev/pylint#6464
Fixed a crash when _filter_stmts encounters an EmptyNode.
Closes pylint-dev/pylint#6438
Fixed an error in the Qt brain when building instance_attrs.
Fixed an error in the Qt brain when building instance_attrs.
Closes PyCQA/pylint#6221
Fixed a crash in the gi brain.
Closes PyCQA/pylint#6371
Release date: 2022-04-19
Fixed an error in the Qt brain when building instance_attrs.
Closes pylint-dev/pylint#6221
Fixed a crash in the gi brain.
Closes pylint-dev/pylint#6371
Avoided adding the name of a parent namedtuple to its child's locals.
Avoided adding the name of a parent namedtuple to its child's locals.
Refs PyCQA/pylint#5982
Release date: 2022-03-26
Avoided adding the name of a parent namedtuple to its child's locals.
Refs pylint-dev/pylint#5982
Promoted getattr() from astroid.scoped_nodes.FunctionDef to its parent astroid.scoped_nodes.Lambda.
Promoted getattr() from astroid.scoped_nodes.FunctionDef to its parent
astroid.scoped_nodes.Lambda.
Fixed crash on direct inference via nodes.FunctionDef._infer.
Closes #817
Release date: 2022-03-22
Promoted getattr() from astroid.scoped_nodes.FunctionDef to its parent
astroid.scoped_nodes.Lambda.
Fixed crash on direct inference via nodes.FunctionDef._infer.
Closes #817
Accessing the doc attribute of nodes.Module, nodes.ClassDef, and nodes.FunctionDef has been deprecated in favour of the doc_node attribute. Note: doc_…
Add new (optional) doc_node attribute to nodes.Module, nodes.ClassDef,
and nodes.FunctionDef.
Accessing the doc attribute of nodes.Module, nodes.ClassDef, and
nodes.FunctionDef has been deprecated in favour of the doc_node attribute.
Note: doc_node is an (optional) nodes.Const whereas doc was an (optional) str.
Passing the doc argument to the __init__ of nodes.Module, nodes.ClassDef,
and nodes.FunctionDef has been deprecated in favour of the postinit doc_node attribute.
Note: doc_node is an (optional) nodes.Const whereas doc was an (optional) str.
Replace custom cachedproperty with functools.cached_property and deprecate it
for Python 3.8+.
Closes #1410
Set end_lineno and end_col_offset attributes to None for all nodes
with PyPy 3.8. PyPy 3.8 assigns these attributes inconsistently which could lead
to unexpected errors. Overwriting them with None will cause a fallback
to the already supported way of PyPy 3.7.
Add missing shape parameter to numpy zeros_like, ones_like,
and full_like methods.
Closes PyCQA/pylint#5871
Only pin wrapt on the major version.
Performance improvements. Only run expensive decorator functions when non-default Deprecation warnings are enabled, eg. during a Pytest run.
Fixed inference of self in binary operations in which self
is part of a list or tuple.
Closes PyCQA/pylint#4826
Fixed builtin inference on property calls not calling the postinit of the new node, which
resulted in instance arguments missing on these nodes.
Fixed a crash on Super.getattr when the attribute was previously uninferable due to a cache
limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the
__init__ attribute) is very large.
Closes PyCQA/pylint#5679
Include names of keyword-only arguments in astroid.scoped_nodes.Lambda.argnames.
Closes PyCQA/pylint#5771
Fixed a crash inferring on a NewType named with an f-string.
Closes PyCQA/pylint#5770
Add support for attrs v21.3.0 which
added a new attrs module alongside the existing attr.
Closes #1330
Use the end_lineno attribute for the NodeNG.tolineno property
when it is available.
Closes #1350
Add is_dataclass attribute to ClassDef nodes.
Use sysconfig instead of distutils to determine the location of
python stdlib files and packages.
Related pull requests: #1322, #1323, #1324 Closes #1282 Ref #1103
Fixed crash with recursion error for inference of class attributes that referenced the class itself.
Closes PyCQA/pylint#5408
Fixed crash when trying to infer items() on the __dict__
attribute of an imported module.
Closes #1085
Add optional NodeNG.position attribute.
Used for block nodes to highlight position of keyword(s) and name
in cases where the AST doesn't provide good enough positional information.
E.g. nodes.ClassDef, nodes.FunctionDef.
Fix ClassDef.fromlineno. For Python < 3.8 the lineno attribute includes decorators.
fromlineno should return the line of the class statement itself.
Performance improvements. Only run expensive decorator functions when non-default Deprecation warnings are enabled, eg. during a Pytest run.
Closes #1383
Fixed regression where packages without a __init__.py file were not recognized or imported correctly.
Fixed regression where packages without a __init__.py file were
not recognized or imported correctly.
Closes #1327
Release date: 2022-01-09
Fixed regression where packages without a __init__.py file were
not recognized or imported correctly.
Closes #1327
Fixed regression in astroid.scoped_nodes where _is_metaclass was not accessible anymore.
astroid.scoped_nodes where _is_metaclass
was not accessible anymore.Closes #1325
Release date: 2022-01-04
astroid.scoped_nodes where _is_metaclass
was not accessible anymore.Closes #1325
NodeNG.frame() and NodeNG.statement() will start raising ParentMissingError instead of AttributeError in astroid 3.0. This behaviour can already be tr
NodeNG.frame() and NodeNG.statement() will start raising ParentMissingError
instead of AttributeError in astroid 3.0. This behaviour can already be triggered
by passing future=True to a frame() or statement() call.
Prefer the module loader get_source() method in AstroidBuilder's module_build() when possible to avoid assumptions about source code being available on a filesystem. Otherwise the source cannot be found and application behavior changes when running within an embedded hermetic interpreter environment (pyoxidizer, etc.).
Require Python 3.6.2 to use astroid.
Removed custom distutils handling for resolving paths to submodules.
Ref #1321
Fix deque.insert() signature in collections brain.
Closes #1260
Fix Module nodes not having a col_offset, end_lineno, and end_col_offset
attributes.
Fix typing and update explanation for Arguments.args being None.
Fix crash if a variable named type is subscripted in a generator expression.
Closes PyCQA/pylint#5461
Enable inference of dataclass import from marshmallow_dataclass. This allows the dataclasses brain to recognize dataclasses annotated by marshmallow_dataclass.
Resolve symlinks in the import path Fixes inference error when the import path includes symlinks (e.g. Python installed on macOS via Homebrew).
Closes #823 Closes PyCQA/pylint#3499 Closes PyCQA/pylint#4302 Closes PyCQA/pylint#4798 Closes PyCQA/pylint#5081
Release date: 2021-12-31
NodeNG.frame() and NodeNG.statement() will start raising ParentMissingError
instead of AttributeError in astroid 3.0. This behaviour can already be triggered
by passing future=True to a frame() or statement() call.
Prefer the module loader get_source() method in AstroidBuilder's module_build() when possible to avoid assumptions about source code being available on a filesystem. Otherwise the source cannot be found and application behavior changes when running within an embedded hermetic interpreter environment (pyoxidizer, etc.).
Require Python 3.6.2 to use astroid.
Removed custom distutils handling for resolving paths to submodules.
Ref #1321
Restore custom distutils handling for resolving paths to submodules.
Closes pylint-dev/pylint#5645
Fix deque.insert() signature in collections brain.
Closes #1260
Fix Module nodes not having a col_offset, end_lineno, and end_col_offset
attributes.
Fix typing and update explanation for Arguments.args being None.
Fix crash if a variable named type is accessed with an index operator ([])
in a generator expression.
Closes pylint-dev/pylint#5461
Enable inference of dataclass import from marshmallow_dataclass. This allows the dataclasses brain to recognize dataclasses annotated by marshmallow_dataclass.
Resolve symlinks in the import path Fixes inference error when the import path includes symlinks (e.g. Python installed on macOS via Homebrew).
Closes #823 Closes pylint-dev/pylint#3499 Closes pylint-dev/pylint#4302 Closes pylint-dev/pylint#4798 Closes pylint-dev/pylint#5081
Add end_lineno and end_col_offset attributes to astroid nodes.
Add end_lineno and end_col_offset attributes to astroid nodes.
Always treat __class_getitem__ as a classmethod.
Add missing as_string visitor method for Unknown node.
Closes #1264
Release date: 2021-11-21
Add end_lineno and end_col_offset attributes to astroid nodes.
Always treat __class_getitem__ as a classmethod.
Add missing as_string visitor method for Unknown node.
Closes #1264
Fix crash on inference of subclasses created from Class().__subclasses__
Fix crash on inference of subclasses created from Class().__subclasses__
Closes PyCQA/pylint#4982
Fix bug with Python 3.7.0 / 3.7.1 and typing.NoReturn.
Closes #1239
Release date: 2021-11-21
Fix crash on inference of subclasses created from Class().__subclasses__
Closes pylint-dev/pylint#4982
Fix bug with Python 3.7.0 / 3.7.1 and typing.NoReturn.
Closes #1239
Use more permissive versions for the typed-ast dependencie (<2.0 instead of <1.5)
Use more permissive versions for the typed-ast dependencie (<2.0 instead of <1.5)
Closes #1237
Fix crash on inference of __len__.
Closes PyCQA/pylint#5244
Added missing kind (for Const) and conversion (for FormattedValue) fields to repr.
Fix crash with assignment expressions, nested if expressions and filtering of statements
Closes PyCQA/pylint#5178
Fix incorrect filtering of assignment expressions statements
Release date: 2021-11-12
Use more permissive versions for the typed-ast dependency (<2.0 instead of <1.5)
Closes #1237
Fix crash on inference of __len__.
Closes pylint-dev/pylint#5244
Added missing kind (for Const) and conversion (for FormattedValue) fields to repr.
Fix crash with assignment expressions, nested if expressions and filtering of statements
Closes pylint-dev/pylint#5178
Fix incorrect filtering of assignment expressions statements
Fix the scope() and frame() methods of NamedExpr nodes. When these nodes occur in Arguments, Keyword or Comprehension nodes these methods now correctl
Fix the scope() and frame() methods of NamedExpr nodes.
When these nodes occur in Arguments, Keyword or Comprehension nodes these
methods now correctly point to the outer-scope of the FunctionDef,
ClassDef, or Comprehension.
Fix the set_local function for NamedExpr nodes.
When these nodes occur in Arguments, Keyword, or Comprehension nodes these
nodes are now correctly added to the locals of the FunctionDef,
ClassDef, or Comprehension.
Fixes handling of nested partial functions
Add support for wrapt 1.13
Fixes handling of nested partial functions
Closes PyCQA/pylint#2462 Closes #1208
Fix regression with the import resolver
Closes PyCQA/pylint#5131
Fix crash with invalid dataclass field call
Closes PyCQA/pylint#5153
Release date: 2021-10-17
Add support for wrapt 1.13
Fixes handling of nested partial functions
Closes pylint-dev/pylint#2462 Closes #1208
Fix regression with the import resolver
Closes pylint-dev/pylint#5131
Fix crash with invalid dataclass field call
Closes pylint-dev/pylint#5153
Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a mistake when creating the tag. See https://github.com/PyCQA/astroid/issues/1199#issue
Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a mistake when creating the tag. See https://github.com/PyCQA/astroid/issues/1199#issuecomment-937320512
Release date: 2021-10-07
Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a mistake when creating the tag.
Nothing published for this version
Astroid does not trigger it's own deprecation warning anymore.
Adds support of type hints inside numpy's brains.
Closes PyCQA/pylint#4326
Enable inference of dataclass import from pydantic.dataclasses. This allows the dataclasses brain to recognize pydantic dataclasses.
Closes PyCQA/pylint#4899
Fix regression on ClassDef inference
Closes PyCQA/pylint#5030 Closes PyCQA/pylint#5036
Fix regression on Compare node inference
Closes PyCQA/pylint#5048
Extended attrs brain to support the provisional APIs
Astroid does not trigger it's own deprecation warning anymore.
Improve brain for typing.Callable and typing.Type.
Fix bug with importing namespace packages with relative imports
Closes PyCQA/pylint#5059
The is_typing_guard and is_sys_guard functions are deprecated and will
be removed in 3.0.0. They are complex meta-inference functions that are better
suited for pylint. Import them from pylint.checkers.utils instead
(requires pylint 2.12).
Suppress the conditional between applied brains and dynamic import authorized modules. (Revert the "The transforms related to a module are applied only if this module has not been explicitly authorized to be imported" of version 2.7.3)
Adds a brain to infer the numpy.ma.masked_where function.
Closes PyCQA/pylint#3342
Release date: 2021-10-06
Adds support of type hints inside numpy's brains.
Closes pylint-dev/pylint#4326
Enable inference of dataclass import from pydantic.dataclasses. This allows the dataclasses brain to recognize pydantic dataclasses.
Closes pylint-dev/pylint#4899
Fix regression on ClassDef inference
Closes pylint-dev/pylint#5030 Closes pylint-dev/pylint#5036
Fix regression on Compare node inference
Closes pylint-dev/pylint#5048
Extended attrs brain to support the provisional APIs
Astroid does not trigger it's own deprecation warning anymore.
Improve brain for typing.Callable and typing.Type.
Fix bug with importing namespace packages with relative imports
Closes pylint-dev/pylint#5059
The is_typing_guard and is_sys_guard functions are deprecated and will
be removed in 3.0.0. They are complex meta-inference functions that are better
suited for pylint. Import them from pylint.checkers.utils instead
(requires pylint 2.12).
Suppress the conditional between applied brains and dynamic import authorized modules. (Revert the "The transforms related to a module are applied only if this module has not been explicitly authorized to be imported" of version 2.7.3)
Adds a brain to infer the numpy.ma.masked_where function.
Closes pylint-dev/pylint#3342
Add additional deprecation warnings in preparation for astroid 3.0
Add additional deprecation warnings in preparation for astroid 3.0
Require attributes for some node classes with __init__ call.
name (str) for Name, AssignName, DelNameattrname (str) for Attribute, AssignAttr, DelAttrop (str) for AugAssign, BinOp, BoolOp, UnaryOpnames (list[tuple[str, str | None]]) for ImportSupport pyz imports
Closes PyCQA/pylint#3887
Add node_ancestors method to NodeNG for obtaining the ancestors of nodes.
It's now possible to infer the value of comparison nodes
Closes #846
Fixed bug in inference of dataclass field calls.
Closes PyCQA/pylint#4963
Release date: 2021-09-14
Add additional deprecation warnings in preparation for astroid 3.0
Require attributes for some node classes with __init__ call.
name (str) for Name, AssignName, DelNameattrname (str) for Attribute, AssignAttr, DelAttrop (str) for AugAssign, BinOp, BoolOp, UnaryOpnames (list[tuple[str, str | None]]) for ImportSupport pyz imports
Closes pylint-dev/pylint#3887
Add node_ancestors method to NodeNG for obtaining the ancestors of nodes.
It's now possible to infer the value of comparison nodes
Closes #846
Fixed bug in inference of dataclass field calls.
Closes pylint-dev/pylint#4963
The transforms related to a module are applied only if this module has not been explicitly authorized to be imported (i.e is not in AstroidManager.ext
The transforms related to a module are applied only if this module has not been explicitly authorized to be imported
(i.e is not in AstroidManager.extension_package_whitelist). Solves the following issues if numpy is authorized to be imported
through the extension-pkg-allow-list option.
Closes PyCQA/pylint#3342 Closes PyCQA/pylint#4326
Fixed bug in attribute inference from inside method calls.
Closes PyCQA/pylint#400
Fixed bug in inference for superclass instance methods called from the class rather than an instance.
Closes #1008 Closes PyCQA/pylint#4377
Fixed bug in inference of chained attributes where a subclass had an attribute that was an instance of its superclass.
Closes PyCQA/pylint#4220
Adds a brain for the ctypes module.
Closes PyCQA/pylint#4896
When processing dataclass attributes, exclude the same type hints from abc.collections as from typing.
Closes PyCQA/pylint#4895
Apply dataclass inference to pydantic's dataclasses.
Closes PyCQA/pylint#4899
Release date: 2021-08-30
The transforms related to a module are applied only if this module has not been explicitly authorized to be imported
(i.e is not in AstroidManager.extension_package_whitelist). Solves the following issues if numpy is authorized to be imported
through the extension-pkg-allow-list option.
Closes pylint-dev/pylint#3342 Closes pylint-dev/pylint#4326
Fixed bug in attribute inference from inside method calls.
Closes pylint-dev/pylint#400
Fixed bug in inference for superclass instance methods called from the class rather than an instance.
Closes #1008 Closes pylint-dev/pylint#4377
Fixed bug in inference of chained attributes where a subclass had an attribute that was an instance of its superclass.
Closes pylint-dev/pylint#4220
Adds a brain for the ctypes module.
Closes pylint-dev/pylint#4896
When processing dataclass attributes, exclude the same type hints from abc.collections as from typing.
Closes pylint-dev/pylint#4895
Apply dataclass inference to pydantic's dataclasses.
Closes pylint-dev/pylint#4899
BaseContainer is now public, and will replace _BaseContainer completely in astroid 3.0.
BaseContainer is now public, and will replace _BaseContainer completely in astroid 3.0.
astroid.const.BUILTINS and astroid.bases.BUILTINS are not used internally anymore
and will be removed in astroid 3.0. Simply replace this by the string 'builtins' for better
performances and clarity.
Add inference for dataclass initializer method.
Closes PyCQA/pylint#3201
Release date: 2021-08-20
BaseContainer is now public, and will replace _BaseContainer completely in astroid 3.0.
The call cache used by inference functions produced by inference_tip
can now be cleared via clear_inference_tip_cache.
astroid.const.BUILTINS and astroid.bases.BUILTINS are not used internally anymore
and will be removed in astroid 3.0. Simply replace this by the string 'builtins' for better
performances and clarity.
Add inference for dataclass initializer method.
Closes pylint-dev/pylint#3201
When processing dataclass attributes, only do typing inference on collection types. Support for instantiating other typing types is left for the futur
When processing dataclass attributes, only do typing inference on collection types. Support for instantiating other typing types is left for the future, if desired.
Closes #1129
Fixed LookupMixIn missing from astroid.node_classes.
Release date: 2021-08-16
When processing dataclass attributes, only do typing inference on collection types. Support for instantiating other typing types is left for the future, if desired.
Closes #1129
Fixed LookupMixIn missing from astroid.node_classes.
Import from astroid.node_classes and astroid.scoped_nodes has been deprecated in favor of astroid.nodes. Only the imports from astroid.nodes will work…
Import from astroid.node_classes and astroid.scoped_nodes has been deprecated in favor of
astroid.nodes. Only the imports from astroid.nodes will work in astroid 3.0.0.
Add support for arbitrary Enum subclass hierachies
Closes PyCQA/pylint#533 Closes PyCQA/pylint#2224 Closes PyCQA/pylint#2626
Add inference tips for dataclass attributes, including dataclasses.field calls. Also add support for InitVar.
Closes PyCQA/pylint#2600 Closes PyCQA/pylint#2698 Closes PyCQA/pylint#3405 Closes PyCQA/pylint#3794
Adds a brain that deals with dynamic import of IsolatedAsyncioTestCase class of the unittest module.
Closes PyCQA/pylint#4060
Release date: 2021-08-15
Import from astroid.node_classes and astroid.scoped_nodes has been deprecated in favor of
astroid.nodes. Only the imports from astroid.nodes will work in astroid 3.0.0.
Add support for arbitrary Enum subclass hierarchies
Closes pylint-dev/pylint#533 Closes pylint-dev/pylint#2224 Closes pylint-dev/pylint#2626
Add inference tips for dataclass attributes, including dataclasses.field calls. Also add support for InitVar.
Closes pylint-dev/pylint#2600 Closes pylint-dev/pylint#2698 Closes pylint-dev/pylint#3405 Closes pylint-dev/pylint#3794
Adds a brain that deals with dynamic import of IsolatedAsyncioTestCase class of the unittest module.
Closes pylint-dev/pylint#4060
Added support to infer return type of typing.cast()
Added support to infer return type of typing.cast()
Fix variable lookup's handling of exclusive statements
Closes PyCQA/pylint#3711
Fix variable lookup's handling of function parameters
Closes PyCQA/astroid#180
Fix variable lookup's handling of except clause variables
Fix handling of classes with duplicated bases with the same name
Closes PyCQA/astroid#1088
Release date: 2021-08-03
Added support to infer return type of typing.cast()
Fix variable lookup handling of exclusive statements
Closes pylint-dev/pylint#3711
Fix variable lookup handling of function parameters
Closes pylint-dev/astroid#180
Fix variable lookup's handling of except clause variables
Fix handling of classes with duplicated bases with the same name
Closes pylint-dev/astroid#1088
Fix a crash when there would be a 'TypeError object does not support item assignment' in the code we parse.
Fix a crash when there would be a 'TypeError object does not support item assignment' in the code we parse.
Closes PyCQA/pylint#4439
Fix a crash when a AttributeInferenceError was raised when failing to find the real name in infer_import_from.
Closes PyCQA/pylint#4692
Release date: 2021-07-21
Fix a crash when there would be a 'TypeError object does not support item assignment' in the code we parse.
Closes pylint-dev/pylint#4439
Fix a crash when a AttributeInferenceError was raised when failing to find the real name in infer_import_from.
Closes pylint-dev/pylint#4692
Fix a crash when a StopIteration was raised when inferring a faulty function in a context manager.
Fix a crash when a StopIteration was raised when inferring a faulty function in a context manager.
Closes PyCQA/pylint#4723
Release date: 2021-07-19
Fix a crash when a StopIteration was raised when inferring a faulty function in a context manager.
Closes pylint-dev/pylint#4723
Added If.is_sys_guard and If.is_typing_guard helper methods
Added If.is_sys_guard and If.is_typing_guard helper methods
Fix a bad inferenece type for yield values inside of a derived class.
Closes PyCQA/astroid#1090
Fix a crash when the node is a 'Module' in the brain builtin inference
Closes PyCQA/pylint#4671
Fix issues when inferring match variables
Closes PyCQA/pylint#4685
Fix lookup for nested non-function scopes
Fix issue that TypedDict instance wasn't callable.
Closes PyCQA/pylint#4715
Add dependency on setuptools and a guard to prevent related exceptions.
Release date: 2021-07-19
Added If.is_sys_guard and If.is_typing_guard helper methods
Fix a bad inference type for yield values inside of a derived class.
Closes pylint-dev/astroid#1090
Fix a crash when the node is a 'Module' in the brain builtin inference
Closes pylint-dev/pylint#4671
Fix issues when inferring match variables
Closes pylint-dev/pylint#4685
Fix lookup for nested non-function scopes
Fix issue that TypedDict instance wasn't callable.
Closes pylint-dev/pylint#4715
Add dependency on setuptools and a guard to prevent related exceptions.
Fix a crash when the inference of the length of a node failed
Fix a crash when the inference of the length of a node failed
Closes PyCQA/pylint#4633
Fix unhandled StopIteration during inference, following the implementation of PEP479 in python 3.7+
Closes PyCQA/pylint#4631 Closes #1080
Release date: 2021-06-30
Fix a crash when the inference of the length of a node failed
Closes pylint-dev/pylint#4633
Fix unhandled StopIteration during inference, following the implementation of PEP479 in python 3.7+
Closes pylint-dev/pylint#4631 Closes #1080
Fix issue with TypedDict for Python 3.9+
Fix issue with TypedDict for Python 3.9+
Closes PyCQA/pylint#4610
Release date: 2021-06-29
Fix issue with TypedDict for Python 3.9+
Closes pylint-dev/pylint#4610
Deprecate Ellipsis node. It will be removed with the next minor release. Checkers that already support Python 3.8+ work without issues. It's only nece…
Appveyor and travis are no longer used in the continuous integration
setuptools_scm has been removed and replaced by tbump in order to not
have hidden runtime dependencies to setuptools
NodeNg, the base node class, is now accessible from astroid or
astroid.nodes as it can be used for typing.
Update enum brain to improve inference of .name and .value dynamic class attributes
Closes PyCQA/pylint#1932 Closes PyCQA/pylint#2062 Closes PyCQA/pylint#2306
Removed Repr, Exec, and Print nodes as the ast nodes
they represented have been removed with the change to Python 3
Deprecate Ellipsis node. It will be removed with the next minor release.
Checkers that already support Python 3.8+ work without issues. It's only
necessary to remove all references to the astroid.Ellipsis node.
This changes will make development of checkers easier as the resulting tree for Ellipsis
will no longer depend on the python version. Background: With Python 3.8 the
ast.Ellipsis node, along with ast.Str, ast.Bytes, ast.Num,
and ast.NamedConstant were merged into ast.Constant.
Deprecated Index and ExtSlice nodes. They will be removed with the
next minor release. Both are now part of the Subscript node.
Checkers that already support Python 3.9+ work without issues.
It's only necessary to remove all references to the astroid.Index and
astroid.ExtSlice nodes. This change will make development of checkers
easier as the resulting tree for ast.Subscript nodes will no longer
depend on the python version. Background: With Python 3.9 ast.Index
and ast.ExtSlice were merged into the ast.Subscript node.
Updated all Match nodes to be internally consistent.
Add Pattern base class.
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →