Releases: pylint-dev/astroid
v3.0.0
-
Add support for Python 3.12, including PEP 695 type parameter syntax.
Closes #2201
-
Remove support for Python 3.7.
Refs #2137
-
Use the global inference cache when inferring, even without an explicit
InferenceContext. This is a significant performance improvement given how
often methods default toNonefor the context argument. (Lintingastroid
itself now takes ~5% less time on Python 3.12; other projects requiring more
complex inference calculations will see greater speedups.)Refs #529
-
Following a deprecation period starting in astroid 2.7.0, the
astroid.node_classes
andastroid.scoped_nodesmodules have been removed in favor ofastroid.nodes.node_classes
andastroid.nodes.scoped_nodes.Closes #1072
-
Following a deprecation period starting in astroid 2.12.0, the
astroid.mixinsmodule
has been removed in favor ofastroid.nodes._base_nodes(private).Refs #1633
-
Return all existing arguments when calling
Arguments.arguments(). This also meansfind_argnamewill now
use the whole list of arguments for its search.Closes #2213
-
Exclude class attributes from the
__members__container of anEnumclass when they are
nodes.AnnAssignnodes with no assigned value. -
Remove
@cachedand@cachedpropertydecorator (just use@cached_propertyfrom the stdlib). -
Remove the
inferencemodule. Node inference methods are now in the module
defining the node, rather than being associated to the node afterward.Closes #679
-
Move
LookupMixIntoastroid.nodes._base_nodesand make it private. -
Remove the shims for
OperationError,BinaryOperationError, andUnaryOperationError
inexceptions. They were moved toutilin astroid 1.5.0. -
Move
safe_infer()fromhelperstoutil. This avoids some circular imports. -
Reduce file system access in
ast_from_file(). -
Reduce time to
import astroidby delayingastroid_bootstrapping()until
the first instantiation ofAstroidBuilder.Closes #2161
-
Make
igetattr()idempotent. This addresses some reports of varying results
when running pylint with--jobs.Closes pylint-dev/pylint#4356
Refs #7 -
Fix incorrect cache keys for inference results, thereby correctly inferring types
for calls instantiating types dynamically.Closes #1828
Closes pylint-dev/pylint#7464
Closes pylint-dev/pylint#8074 -
Fix interrupted
InferenceContextcall chains, thereby addressing performance
problems when lintingsqlalchemy.Closes pylint-dev/pylint#8150
-
nodes.FunctionDefno longer inherits fromnodes.Lambda.
This is a breaking change but considered a bug fix as the nodes did not share the same
API and were not interchangeable.We have tried to minimize the amount of breaking changes caused by this change
but some are unavoidable. -
infer_call_resultnow shares the same interface across all implementations. Namely:def infer_call_result( self, caller: SuccessfulInferenceResult | None, context: InferenceContext | None = None, ) -> Iterator[InferenceResult]:
This is a breaking change for
nodes.FunctionDefwhere previouslycallerhad a default of
None. PassingNoneagain will not create a behaviour change.
The breaking change allows us to better type and re-use the method withinastroid. -
Improved signature of the
__init__and__postinit__methods of most nodes.
This includes makinglineno,col_offset,end_lineno,end_col_offsetandparent
required arguments fornodes.NodeNGand its subclasses.
For most other nodes, arguments of their__postinit__methods have been made required to better
represent how they would normally be constructed by the standard libraryastmodule.
The following nodes were changed or updated:nodes.AnnAssignnodes.Argumentsnodes.Assignnodes.AssignAttrnodes.AssignNamenodes.Attributenodes.AugAssignnodes.Awaitnodes.BaseContainernodes.BinOpnodes.Callnodes.ClassDefnodes.Comparenodes.Comprehensionnodes.Decoratorsnodes.Deletenodes.DelAttrnodes.DelNamenodes.Dictnodes.DictCompnodes.ExceptHandlernodes.Exprnodes.Fornodes.FunctionDefnodes.GeneratorExpnodes.Ifnodes.IfExpnodes.Keywordnodes.Lambdanodes.ListCompnodes.Modulenodes.Namenodes.NodeNGnodes.Raisenodes.Returnnodes.SetCompnodes.Slicenodes.Starredobjects.Super, we also added thecallparameter to its__init__method.nodes.Subscriptnodes.UnaryOpnodes.Whilenodes.Yield
These changes involve breaking changes to their API but should be considered bug fixes. We
now make arguments required when they are instead of always providing defaults. -
nodes.If.self.is_orelsehas been removed as it was never set correctly and therefore
provided a false value. -
Remove dependency on
wrapt. -
Remove dependency on
lazy_object_proxy. This includes the removal
of the associatedlazy_import,lazy_descriptorandproxy_aliasutility functions. -
CallSite._unpack_argsandCallSite._unpack_keywordsnow usesafe_infer()for
better inference and fewer false positives.Closes pylint-dev/pylint#8544
-
Add
attr.Factoryto the recognized class attributes for classes decorated withattrs.Closes pylint-dev/pylint#4341
-
infer_property()now observes the same property-specific workaround asinfer_functiondef.Refs #1490
-
Remove unused and / or deprecated constants:
astroid.bases.BOOL_SPECIAL_METHODastroid.bases.BUILTINSastroid.const.BUILTINSastroid.const.PY38_PLUSastroid.const.Loadastroid.const.Storeastroid.const.Del
Refs #2141
-
frame()raisesParentMissingErrorandstatement()raisesStatementMissingfor
missing parents regardless of the value of thefutureargument (which gave this behavior
already).The
futureargument to each method is deprecated and will be removed in astroid 4.0.Refs #1217
-
Remove deprecated
Ellipsis,ExtSlice,Indexnodes.Refs #2152
-
Remove deprecated
is_sys_guardandis_typing_guardmethods.Refs #2153
-
Remove deprecated
docattribute forModule,ClassDef, andFunctionDef.
Use thedoc_nodeattribute instead.Refs #2154
-
Add new
nodes.Tryto better match Python AST. Replaces theTryExcept
andTryFinallynodes which have been removed. -
Publicize
NodeNG.repr_name()to facilitate finding a node's nice name. -
Fix false positives for
no-memberandinvalid-namewhen using the_name_,_value_and_ignore_sunders in Enums.Closes pylint-dev/pylint#9015
v2.15.8
-
Fix a regression in 2.15.7 for
unsubscriptable-object.Closes #2305
Closes pylint-dev/pylint#9069
v3.0.0b0
Pre-release for astroid 3.0.0, with API deprecation applied.
v2.15.7
-
Fix a crash when inferring a
typing.TypeVarcall.Closes pylint-dev/pylint#8802
-
Infer user-defined enum classes by checking if the class is a subtype of
enum.Enum.Closes pylint-dev/pylint#8897
-
Fix inference of functions with
@functools.lru_cachedecorators without
parentheses.Closes pylint-dev/pylint#8868
-
Make
sys.argvuninferable because it never is. (It's impossible to infer
the value it will have outside of static analysis where it's our own value.)
v3.0.0a9
Pre-release for astroid 3.0.0, with performance improvements, fixes for Python 3.12 compatibility, and an improvement to Arguments.arguments(), among other changes.
See the full list of changes.
v3.0.0a8
Pre-release for astroid 3.0.0, for #2250 and python 3.12 in pylint. For a full list of changes see https://github.com/pylint-dev/astroid/blob/v3.0.0a8/ChangeLog
v3.0.0a7
This is the seventh pre-release for astroid 3.0.0, main change is added Try node. For a full list of changes see https://github.com/pylint-dev/astroid/blob/v3.0.0a7/ChangeLog
v2.15.6
-
Harden
get_module_part()against".".Closes pylint-dev/pylint#8749
-
Avoid expensive list/tuple multiplication operations that would result in
MemoryError.Closes pylint-dev/pylint#8748
v3.0.0a6
This is the sixth pre-release for astroid 3.0.0, main change is the python 3.12 support. For a full list of changes see https://github.com/pylint-dev/astroid/blob/v3.0.0a6/ChangeLog
3.0.0a5
This is the fifth pre-release for astroid 3.0.0. For a full list of changes see https://github.com/pylint-dev/astroid/blob/v3.0.0a5/ChangeLog