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_parametersreturns 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.getattrto look into both instance attrs and special attributesClose pylint-dev/pylint#1078
-
Infer qualified
classmethodas a classmethod.Close pylint-dev/pylint#3417
-
Prevent a recursion error to happen when inferring the declared metaclass of a class
Close #749
-
Raise
AttributeInferenceErrorwhengetattr()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 optionalcontextparameterWe 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.Argumentsto 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_subscriptpath_wrapperneeds to come first, followed byraise_if_nothing_inferred,
otherwise we won't handleStopIterationcorrectly.Close #762
-
Prevent a recursion error when inferring self-referential variables without definition
Close pylint-dev/pylint#1285
-
Numpy
datetime64.astypereturn value is inferred as andarray.Close pylint-dev/pylint#3332
-
Skip non
AssignandAnnAssignnodes from enum reinterpretationCloses pylint-dev/pylint#3365
-
Numpy
ndarrayattributesimagandrealare now inferred asndarray.Close pylint-dev/pylint#3322
-
Added a call to
register_transformfor all functions of thebrain_numpy_core_multiarray
module in case the current node is an instance ofastroid.NameClose #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_umathmoduleClose pylint-dev/pylint#3319
-
Added some functions of the
numpy.core.multiarraymoduleClose pylint-dev/pylint#3208
-
All the
numpy ufuncfunctions derived now from a common class that
implements the specificreduce,accumulate,reduceat,
outerandatmethods.Close pylint-dev/pylint#2885
-
nodes.Const.iteredreturns a list ofConstnodes, not stringsClose pylint-dev/pylint#3306
-
The
shapeattribute of anumpy ndarrayis now andarrayClose 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 theastlibrary. 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 theselfto 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.ExceptionInstancehas
support for better inference of.argsand other exception related
attributes that normal instances do not have.
This additional support should remove certain false positives related
to.argsand other exception attributes inpylint.Close pylint-dev/pylint#2333
-
Add more supported parameters to
subprocess.check_outputClose #722
-
Infer args unpacking of
selfCertain stdlib modules use
*argsto encapsulate
theselfparameter, 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_posonlyargsand
Arguments.type_comment_kwonlyargsattributes respectively. -
Relax upper bound on
wraptClose #755
-
Properly analyze CFFI compiled extensions.