Releases: pylint-dev/astroid
astroid-2.5.1
-
The
context.path
is reverted to a set because otherwise it leads to false positives
for nonnumpy
functions. -
Don't transform dataclass ClassVars
-
Improve typing.TypedDict inference
-
Fix the
Duplicates found in MROs
false positive.Closes #905
Closes pylint-dev/pylint#2717
Closes pylint-dev/pylint#3247
Closes pylint-dev/pylint#4093
Closes pylint-dev/pylint#4131
Closes pylint-dev/pylint#4145
astroid 2.5
-
Adds
attr_fset
in thePropertyModel
class.Fixes pylint-dev/pylint#3480
-
Remove support for Python 3.5.
-
Remove the runtime dependency on
six
. Thesix
brain remains in
astroid.Fixes #863
-
Enrich the
brain_collection
module so that__class_getitem__
method is added todeque
for
python
version above 3.9. -
The
context.path
is now adict
and thecontext.push
method
returnsTrue
if the node has been visited a certain amount of times.Close #669
-
Adds a brain for type object so that it is possible to write
type[int]
in annotation.Fixes pylint-dev/pylint#4001
-
Add
__class_getitem__
method tosubprocess.Popen
brain under Python 3.9 so that it is seen as subscriptable by pylint.Fixes pylint-dev/pylint#4034
-
Adds
degrees
,radians
, which arenumpy ufunc
functions, in thenumpy
brain. Addsrandom
function in thenumpy.random
brain.Fixes pylint-dev/pylint#3856
-
Fix deprecated importlib methods
Closes #703
-
Fix a crash in inference caused by
Uninferable
container elementsClose #866
-
Add
python 3.9
support. -
The flat attribute of
numpy.ndarray
is now inferred as annumpy.ndarray
itself.
It should be anumpy.flatiter
instance, but this class is not yet available in the numpy brain.Fixes pylint-dev/pylint#3640
-
Fix a bug for dunder methods inference of function objects
Fixes #819
-
Fixes a bug in the signature of the
ndarray.__or__
method,
in thebrain_numpy_ndarray.py
module.Fixes #815
-
Fixes a to-list cast bug in
starred_assigned_stmts
method,
in the ``protocols.py` module. -
Added a brain for
hypothesis.strategies.composite
-
The transpose of a
numpy.ndarray
is also anumpy.ndarray
Fixes pylint-dev/pylint#3387
-
Added a brain for
sqlalchemy.orm.session
-
Separate string and bytes classes patching
Fixes pylint-dev/pylint#3599
-
Prevent recursion error for self referential length calls
Close #777
-
Added missing methods to the brain for
mechanize
, to fix pylint false positivesClose #793
-
Added more supported parameters to
subprocess.check_output
-
Fix recursion errors with pandas
Fixes pylint-dev/pylint#2843
Fixes pylint-dev/pylint#2811 -
Added exception inference for
UnicodeDecodeError
Close pylint-dev/pylint#3639
-
FunctionDef.is_generator
properly handlesyield
nodes inIf
testsClose pylint-dev/pylint#3583
-
Fixed exception-chaining error messages.
-
Fix failure to infer base class type with multiple inheritance and qualified names
Fixes #843
-
Fix interpretation of
six.with_metaclass
class definitions.Fixes #713
-
Reduce memory usage of astroid's module cache.
-
Remove dependency on
imp
. -
Do not crash when encountering starred assignments in enums.
Close #835
-
Fix a crash in functools.partial inference when the arguments cannot be determined
Close pylint-dev/pylint#3776
-
Fix a crash caused by a lookup of a monkey-patched method
Close pylint-dev/pylint#3686
-
is_generator
correctly considersYield
nodes inAugAssign
nodesThis fixes a false positive with the
assignment-from-no-return
pylint check.Close pylint-dev/pylint#3904
-
Corrected the parent of function type comment nodes.
These nodes used to be parented to their original ast.FunctionDef parent
but are now correctly parented to their astroid.FunctionDef parent.Close #851
astroid-2.4.2
-
FunctionDef.is_generator
properly handlesyield
nodes inWhile
testsClose pylint-dev/pylint#3519
-
Properly construct the arguments of infered property descriptors
Close pylint-dev/pylint#3648
astroid-2.4.1
-
Handle the case where the raw builder fails to retrieve the
__all__
attributeClose #772
-
Restructure the AST parsing heuristic to always pick the same module
Close pylint-dev/pylint#3540
Close #773 -
Changed setup.py to work with distlib
Close #779
-
Do not crash with SyntaxError when parsing namedtuples with invalid label
Close pylint-dev/pylint#3549
-
Protect against
infer_call_result
failing withInferenceError
inSuper.getattr()
Close pylint-dev/pylint#3529
astroid 2.4.0
Release Date: 2020-04-27
-
Expose a ast_from_string method in AstroidManager, which will accept
source code as a string and return the corresponding astroid objectCloses #725
-
BoundMethod.implicit_parameters
returns a proper value for__new__
Close pylint-dev/pylint#2335
-
Allow slots added dynamically to a class to still be inferred
Close pylint-dev/pylint#2334
-
Allow
FunctionDef.getattr
to look into both instance attrs and special attributesClose pylint-dev/pylint#1078
-
Infer qualified
classmethod
as a classmethod.Close pylint-dev/pylint#3417
-
Prevent a recursion error to happen when inferring the declared metaclass of a class
Close #749
-
Raise
AttributeInferenceError
whengetattr()
receives an empty nameClose pylint-dev/pylint#2991
-
Prevent a recursion error for self reference variables and
type()
calls.Close #199
-
Do not infer the first argument of a staticmethod in a metaclass as the class itself
Close pylint-dev/pylint#3032
-
NodeNG.bool_value()
gained an optionalcontext
parameterWe need to pass an inference context downstream when inferring the boolean
value of a node in order to prevent recursion errors and double inference.This fix prevents a recursion error with dask library.
Close pylint-dev/pylint#2985
-
Pass a context argument to
astroid.Arguments
to prevent recursion errorsClose pylint-dev/pylint#3414
-
Better inference of class and static methods decorated with custom methods
Close pylint-dev/pylint#3209
-
Reverse the order of decorators for
infer_subscript
path_wrapper
needs to come first, followed byraise_if_nothing_inferred
,
otherwise we won't handleStopIteration
correctly.Close #762
-
Prevent a recursion error when inferring self-referential variables without definition
Close pylint-dev/pylint#1285
-
Numpy
datetime64.astype
return value is inferred as andarray
.Close pylint-dev/pylint#3332
-
Skip non
Assign
andAnnAssign
nodes from enum reinterpretationCloses pylint-dev/pylint#3365
-
Numpy
ndarray
attributesimag
andreal
are now inferred asndarray
.Close pylint-dev/pylint#3322
-
Added a call to
register_transform
for all functions of thebrain_numpy_core_multiarray
module in case the current node is an instance ofastroid.Name
Close #666
-
Use the parent of the node when inferring aug assign nodes instead of the statement
Close pylint-dev/pylint#2911
Close pylint-dev/pylint#3214 -
Added some functions to the
brain_numpy_core_umath
moduleClose pylint-dev/pylint#3319
-
Added some functions of the
numpy.core.multiarray
moduleClose pylint-dev/pylint#3208
-
All the
numpy ufunc
functions derived now from a common class that
implements the specificreduce
,accumulate
,reduceat
,
outer
andat
methods.Close pylint-dev/pylint#2885
-
nodes.Const.itered
returns a list ofConst
nodes, not stringsClose pylint-dev/pylint#3306
-
The
shape
attribute of anumpy ndarray
is now andarray
Close pylint-dev/pylint#3139
-
Don't ignore special methods when inspecting gi classes
Close #728
-
Added transform for
scipy.gaussian
-
Add suport for inferring properties.
-
Added a brain for
responses
-
Allow inferring positional only arguments.
-
Retry parsing a module that has invalid type comments
It is possible for a module to use comments that might be interpreted
as type comments by theast
library. We do not want to completely crash on those
invalid type comments.Close #708
-
Scope the inference to the current bound node when inferring instances of classes
When inferring instances of classes from arguments, such as
self
in a bound method, we could use as a hint the context'sboundnode
,
which indicates the instance from which the inference originated.
As an example, a subclass that uses a parent's method which returns
self
, will override theself
to point to it instead of pointing
to the parent class.Close pylint-dev/pylint#3157
-
Add support for inferring exception instances in all contexts
We were able to infer exception instances as
ExceptionInstance
only for a handful of cases, but not all.ExceptionInstance
has
support for better inference of.args
and other exception related
attributes that normal instances do not have.
This additional support should remove certain false positives related
to.args
and other exception attributes inpylint
.Close pylint-dev/pylint#2333
-
Add more supported parameters to
subprocess.check_output
Close #722
-
Infer args unpacking of
self
Certain stdlib modules use
*args
to encapsulate
theself
parameter, which results in uninferable
instances given we rely on the presence of theself
argument to figure out the instance where we should be
setting attributes.Close pylint-dev/pylint#3216
-
Clean up setup.py
Make pytest-runner a requirement only if running tests, similar to what was
done with McCabe.Clean up the setup.py file, resolving a handful of minor warnings with it.
-
Handle StopIteration error in infer_int.
Close pylint-dev/pylint#3274
-
Can access per argument type comments for positional only and keyword only arguments.
The comments are accessed through through the new
Arguments.type_comment_posonlyargs
and
Arguments.type_comment_kwonlyargs
attributes respectively. -
Relax upper bound on
wrapt
Close #755
-
Properly analyze CFFI compiled extensions.
astroid 2.3.2
-
All type comments have as parent the corresponding
astroid
nodeUntil now they had as parent the builtin
ast
node which meant
we were operating with primitive objects instead of our own.Close pylint-dev/pylint#3174
-
Pass an inference context to
metaclass()
when inferring an object typeThis should prevent a bunch of recursion errors happening in pylint.
Also refactor the inference ofIfExp
nodes to use separate contexts
for each potential branch.Close pylint-dev/pylint#3152
Close pylint-dev/pylint#3159
astroid 2.3.1
Release Date: 2019-09-30
-
A transform for the builtin
dataclasses
module was added.This should address various
dataclasses
issues that were surfaced
even more after the release of pylint 2.4.0.
In the previous versions ofastroid
, annotated assign nodes were
allowed to be retrieved viagetattr()
but that no longer happens
with the latestastroid
release, as those attribute are not actual
attributes, but rather virtual ones, thus an operation such asgetattr()
does not make sense for them. -
Update attr brain to partly understand annotated attributes
Close #656
astroid 2.3.0
Release Date: 2019-09-24
-
Add a brain tip for
subprocess.check_output
Close #689
-
Remove NodeNG.nearest method because of lack of usage in astroid and pylint.
Close #691
-
Allow importing wheel files. Close #541
-
Annotated AST follows PEP8 coding style when converted to string.
-
Fix a bug where defining a class using type() could cause a DuplicateBasesError.
Close #644
-
Dropped support for Python 3.4.
-
Numpy brain support is improved.
Numpy's fundamental type
numpy.ndarray
has its own brain :brain_numpy_ndarray
and
each numpy module that necessitates brain action has now its own numpy brain :numpy.core.numeric
numpy.core.function_base
numpy.core.multiarray
numpy.core.numeric
numpy.core.numerictypes
numpy.core.umath
numpy.random.mtrand
Close pylint-dev/pylint#2865
Close pylint-dev/pylint#2747
Close pylint-dev/pylint#2721
Close pylint-dev/pylint#2326
Close pylint-dev/pylint#2021 -
assert
only functions are properly inferred as returningNone
Close #668
-
Add support for Python 3.8's
NamedExpr
nodes, which is part of assignment expressions.Close #674
-
Added support for inferring
IfExp
nodes. -
Instances of exceptions are inferred as such when inferring in non-exception context
This allows special inference support for exception attributes such as
.args
.Close pylint-dev/pylint#2333
-
Drop a superfluous and wrong callcontext when inferring the result of a context manager
Close pylint-dev/pylint#2859
-
igetattr
raisesInferenceError
on re-inference of the same objectThis prevents
StopIteration
from leaking when we encounter the same
object in the current context, which could result in variousRuntimeErrors
leaking in other parts of the inference.
Until we get a global context per inference, the solution is sort of a hack,
as with the suggested global context improvement, we could theoretically
reuse the same inference object.Close #663
-
Variable annotations can no longer be retrieved with
ClassDef.getattr
Unless they have an attached value, class variable annotations can no longer
be retrieved withClassDef.getattr.
-
Improved builtin inference for
tuple
,set
,frozenset
,list
anddict
We were properly inferring these callables only if they had consts as
values, but that is not the case most of the time. Instead we try to infer
the values that their arguments can be and use them instead of assuming
Const nodes all the time.Close pylint-dev/pylint#2841
-
The last except handler wins when inferring variables bound in an except handler.
Close pylint-dev/pylint#2777
-
threading.Lock.locked()
is properly recognized as a member ofthreading.Lock
Close pylint-dev/pylint#2791
-
Fix recursion error involving
len
and self referential attributesClose pylint-dev/pylint#2736
Close pylint-dev/pylint#2734
Close pylint-dev/pylint#2740 -
Can access per argument type comments through new
Arguments.type_comment_args
attribute.Close #665
-
Fix being unable to access class attributes on a NamedTuple.
Close pylint-dev/pylint#1628
-
Fixed being unable to find distutils submodules by name when in a virtualenv.
Close pylint-dev/pylint#73