Releases: pylint-dev/astroid
v2.11.1
v2.11.0
-
Add new (optional)
doc_nodeattribute tonodes.Module,nodes.ClassDef,
andnodes.FunctionDef. -
Accessing the
docattribute ofnodes.Module,nodes.ClassDef, and
nodes.FunctionDefhas been deprecated in favour of thedoc_nodeattribute.
Note:doc_nodeis an (optional)nodes.Constwhereasdocwas an (optional)str. -
Passing the
docargument to the__init__ofnodes.Module,nodes.ClassDef,
andnodes.FunctionDefhas been deprecated in favour of thepostinitdoc_nodeattribute.
Note:doc_nodeis an (optional)nodes.Constwhereasdocwas an (optional)str. -
Replace custom
cachedpropertywithfunctools.cached_propertyand deprecate it
for Python 3.8+.Closes #1410
-
Set
end_linenoandend_col_offsetattributes toNonefor all nodes
with PyPy 3.8. PyPy 3.8 assigns these attributes inconsistently which could lead
to unexpected errors. Overwriting them withNonewill cause a fallback
to the already supported way of PyPy 3.7. -
Add missing
shapeparameter to numpyzeros_like,ones_like,
andfull_likemethods.Closes pylint-dev/pylint#5871
-
Only pin
wrapton the major version.
v2.10.0
-
Fixed inference of
selfin binary operations in whichself
is part of a list or tuple.Closes pylint-dev/pylint#4826
-
Fixed builtin inference on
propertycalls not calling thepostinitof the new node, which
resulted in instance arguments missing on these nodes. -
Fixed a crash on
Super.getattrwhen 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 pylint-dev/pylint#5679
-
Include names of keyword-only arguments in
astroid.scoped_nodes.Lambda.argnames.Closes pylint-dev/pylint#5771
-
Fixed a crash inferring on a
NewTypenamed with an f-string.Closes pylint-dev/pylint#5770
-
Add support for attrs v21.3.0 which
added a newattrsmodule alongside the existingattr.Closes #1330
-
Use the
end_linenoattribute for theNodeNG.tolinenoproperty
when it is available.Closes #1350
-
Add
is_dataclassattribute toClassDefnodes. -
Use
sysconfiginstead ofdistutilsto 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 pylint-dev/pylint#5408
-
Fixed crash when trying to infer
items()on the__dict__
attribute of an imported module.Closes #1085
-
Add optional
NodeNG.positionattribute.
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 thelinenoattribute includes decorators.
fromlinenoshould return the line of theclassstatement itself. -
Performance improvements. Only run expensive decorator functions when
non-default Deprecation warnings are enabled, eg. during a Pytest run.Closes #1383
v2.9.3
v2.9.2
v2.9.1
-
NodeNG.frame()andNodeNG.statement()will start raisingParentMissingError
instead ofAttributeErrorin astroid 3.0. This behaviour can already be triggered
by passingfuture=Trueto aframe()orstatement()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
distutilshandling for resolving paths to submodules.Ref #1321
-
Fix
deque.insert()signature incollectionsbrain.Closes #1260
-
Fix
Modulenodes not having acol_offset,end_lineno, andend_col_offset
attributes. -
Fix typing and update explanation for
Arguments.argsbeingNone. -
Fix crash if a variable named
typeis subscripted 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
v2.9.0
v2.8.6
-
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
v2.8.5
-
Use more permissive versions for the
typed-astdependencie (<2.0 instead of <1.5)Closes #1237
-
Fix crash on inference of
__len__.Closes pylint-dev/pylint#5244
-
Added missing
kind(forConst) andconversion(forFormattedValue) 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
v2.8.4
-
Fix the
scope()andframe()methods ofNamedExprnodes.
When these nodes occur inArguments,KeywordorComprehensionnodes these
methods now correctly point to the outer-scope of theFunctionDef,
ClassDef, orComprehension. -
Fix the
set_localfunction forNamedExprnodes.
When these nodes occur inArguments,Keyword, orComprehensionnodes these
nodes are now correctly added to the locals of theFunctionDef,
ClassDef, orComprehension.