Age | Commit message (Collapse) | Author | Files | Lines |
|
What's New in astroid 2.12.13?
==============================
* Prevent returning an empty list for ``ClassDef.slots()`` when the mro list contains one class & it is not ``object``.
* Prevent a crash when inferring calls to ``str.format`` with inferred arguments
that would be invalid.
* Infer the `length` argument of the ``random.sample`` function.
* Catch ``ValueError`` when indexing some builtin containers and sequences during inference.
|
|
What's New in astroid 2.12.12?
==============================
* Add the ``length`` parameter to ``hash.digest`` & ``hash.hexdigest`` in the ``hashlib`` brain.
* Prevent a crash when a module's ``__path__`` attribute is unexpectedly missing.
* Fix inferring attributes with empty annotation assignments if parent
class contains valid assignment.
|
|
What's New in astroid 2.12.11?
==============================
* Improve detection of namespace packages for the modules with ``__spec__`` set to None.
* Fixed a regression in the creation of the ``__init__`` of dataclasses with
multiple inheritance.
|
|
What's New in astroid 2.12.10?
==============================
* Fixed a crash when introspecting modules compiled by `cffi`.
* ``decorators.cached`` now gets its cache cleared by calling ``AstroidManager.clear_cache``.
|
|
What's New in astroid 2.12.9?
=============================
* Fixed creation of the ``__init__`` of ``dataclassess`` with multiple inheritance.
* Fixed a crash on ``namedtuples`` that use ``typename`` to specify their name.
|
|
What's New in astroid 2.12.8?
=============================
* Fixed a crash in the ``dataclass`` brain for ``InitVars`` without subscript typing.
* Fixed parsing of default values in ``dataclass`` attributes.
What's New in astroid 2.12.7?
=============================
* Fixed a crash in the ``dataclass`` brain for uninferable bases.
|
|
What's New in astroid 2.12.6?
* Fix a crash involving ``Uninferable`` arguments to ``namedtuple()``.
* The ``dataclass`` brain now understands the ``kw_only`` keyword in dataclass decorators.
|
|
What's New in astroid 2.12.5?
* Prevent first-party imports from being resolved to `site-packages`.
* Fix ``astroid.interpreter._import.util.is_namespace()`` incorrectly
returning ``True`` for frozen stdlib modules on PyPy.
|
|
What's New in astroid 2.12.4?
* Fixed a crash involving non-standard type comments such as ``# type: # any comment``.
What's New in astroid 2.12.3?
* Fixed crash in ``ExplicitNamespacePackageFinder`` involving ``_SixMetaPathImporter``.
* Fix unhandled `FutureWarning` from pandas import in cython modules
* Fix false positive with inference of type-annotated Enum classes.
* 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 `%`.
* Fix false positive with inference of ``http`` module when iterating ``HTTPStatus``.
* 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.
|
|
What's New in astroid 2.12.2?
=============================
* Fixed crash in modulo operations for divisions by zero.
* Fixed crash with recursion limits during inference.
What's New in astroid 2.12.1?
=============================
* 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.
What's New in astroid 2.12.0?
=============================
* Fix signal has no ``connect`` member for PySide2 5.15.2+ and PySide6
* ``astroid`` now requires Python 3.7.2 to run.
* Avoid setting a Call as a base for classes created using ``six.with_metaclass()``.
* 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``.
* The ``astroid.mixins`` module has been deprecated and marked for removal in 3.0.0.
* Capture and log messages emitted by C extensions when importing them.
This prevents contaminating programmatic output, e.g. pylint's JSON reporter.
* Calls to ``str.format`` are now correctly inferred.
* ``__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.
* Adds missing enums from ``ssl`` module.
* Remove dependency on ``pkg_resources`` from ``setuptools``.
* Allowed ``AstroidManager.clear_cache`` to reload necessary brain plugins.
* Fixed incorrect inferences after rebuilding the builtins module, e.g. by calling
``AstroidManager.clear_cache``.
* 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.
* 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.
* 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``.
* 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.
* Avoid inferring the results of ``**`` operations involving values greater than ``1e5``
to avoid expensive computation.
* Fix test for Python ``3.11``. In some instances ``err.__traceback__`` will
be uninferable now.
* Add brain for numpy core module ``einsumfunc``.
* Infer the ``DictUnpack`` value for ``Dict.getitem`` calls.
* Fix a crash involving properties within ``try ... except`` blocks.
* Prevent creating ``Instance`` objects that proxy other ``Instance``s when there is
ambiguity (or user error) in calling ``__new__(cls)``.
|
|
What's New in astroid 2.11.6?
=============================
* 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.
|
|
v2.11.5
Fix crash while obtaining object_type() of an Unknown node.
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.
|
|
What's New in astroid 2.11.4?
=============================
* 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.
* Made ``FunctionDef.implicit_parameters`` return 1 for methods by making
``FunctionDef.is_bound`` return ``True``, as it does for class methods.
* Fixed a crash when ``_filter_stmts`` encounters an ``EmptyNode``.
|
|
What's New in astroid 2.11.3?
=============================
* Fixed an error in the Qt brain when building ``instance_attrs``.
* Fixed a crash in the ``gi`` brain.
What's New in astroid 2.11.2?
=============================
* Avoided adding the name of a parent namedtuple to its child's locals.
What's New in astroid 2.11.1?
=============================
* Promoted ``getattr()`` from ``astroid.scoped_nodes.FunctionDef`` to its parent
``astroid.scoped_nodes.Lambda``.
* Fixed crash on direct inference via ``nodes.FunctionDef._infer``.
What's New in astroid 2.11.0?
=============================
* 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+.
* 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.
* Only pin ``wrapt`` on the major version.
What's New in astroid 2.10.0?
=============================
* Fixed inference of ``self`` in binary operations in which ``self``
is part of a list or tuple.
* 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.
* Inlcude names of keyword-only arguments in ``astroid.scoped_nodes.Lambda.argnames``.
* Fixed a crash inferring on a ``NewType`` named with an f-string.
* Add support for [attrs v21.3.0](https://github.com/python-attrs/attrs/releases/tag/21.3.0) which
added a new `attrs` module alongside the existing `attr`.
* Use the ``end_lineno`` attribute for the ``NodeNG.tolineno`` property
when it is available.
* Add ``is_dataclass`` attribute to ``ClassDef`` nodes.
* Use ``sysconfig`` instead of ``distutils`` to determine the location of
python stdlib files and packages.
* Fixed crash with recursion error for inference of class attributes that referenced
the class itself.
* Fixed crash when trying to infer ``items()`` on the ``__dict__``
attribute of an imported module.
* 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.
|
|
What's New in astroid 2.9.3?
* Fixed regression where packages without a ``__init__.py`` file were
not recognized or imported correctly.
|
|
What's New in astroid 2.9.2?
============================
Release date: 2022-01-04
* Fixed regression in ``astroid.scoped_nodes`` where ``_is_metaclass``
was not accessible anymore.
What's New in astroid 2.9.1?
============================
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.
* Fix ``deque.insert()`` signature in ``collections`` brain.
* 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.
* 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).
|
|
v2.9.0:
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.
|
|
What's New in astroid 2.8.5?
============================
* Use more permissive versions for the ``typed-ast`` dependencie (<2.0 instead of <1.5)
* Fix crash on inference of ``__len__``.
* Added missing ``kind`` (for ``Const``) and ``conversion`` (for ``FormattedValue``) fields to repr.
* Fix crash with assignment expressions, nested if expressions and filtering of statements
* Fix incorrect filtering of assignment expressions statements
|
|
What's New in astroid 2.8.4?
============================
* 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``.
What's New in astroid 2.8.3?
============================
* Add support for wrapt 1.13
* Fixes handling of nested partial functions
* Fix regression with the import resolver
* Fix crash with invalid dataclass field call
What's New in astroid 2.8.2?
============================
Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a
mistake when creating the tag.
What's New in astroid 2.8.1?
============================
* Adds support of type hints inside numpy's brains.
* Enable inference of dataclass import from pydantic.dataclasses.
This allows the dataclasses brain to recognize pydantic dataclasses.
* Fix regression on ClassDef inference
* Fix regression on Compare node inference
* 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
* 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.
What's New in astroid 2.8.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``, ``DelName``
* ``attrname`` (``str``) for ``Attribute``, ``AssignAttr``, ``DelAttr``
* ``op`` (``str``) for ``AugAssign``, ``BinOp``, ``BoolOp``, ``UnaryOp``
* ``names`` (``list[tuple[str, str | None]]``) for ``Import``
* Support pyz imports
* Add ``node_ancestors`` method to ``NodeNG`` for obtaining the ancestors of nodes.
* It's now possible to infer the value of comparison nodes
* Fixed bug in inference of dataclass field calls.
|
|
All checksums have been double-checked against existing RMD160 and
SHA512 hashes
Could not be committed due to merge conflict:
devel/py-traitlets/distinfo
The following distfiles were unfetchable (note: some may be only fetched
conditionally):
./devel/pvs/distinfo pvs-3.2-solaris.tgz
./devel/eclipse/distinfo eclipse-sourceBuild-srcIncluded-3.0.1.zip
|
|
|
|
What's New in astroid 2.7.3?
============================
* 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.
* Fixed bug in attribute inference from inside method calls.
* Fixed bug in inference for superclass instance methods called
from the class rather than an instance.
* Fixed bug in inference of chained attributes where a subclass
had an attribute that was an instance of its superclass.
* Adds a brain for the ctypes module.
* When processing dataclass attributes, exclude the same type hints from abc.collections
as from typing.
* Apply dataclass inference to pydantic's dataclasses.
What's New in astroid 2.7.2?
============================
* ``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.
What's New in astroid 2.7.1?
============================
* When processing dataclass attributes, only do typing inference on collection types.
Support for instantiating other typing types is left for the future, if desired.
* Fixed LookupMixIn missing from ``astroid.node_classes``.
What's New in astroid 2.7.0?
============================
* 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
* Add inference tips for dataclass attributes, including dataclasses.field calls.
Also add support for InitVar.
* Adds a brain that deals with dynamic import of `IsolatedAsyncioTestCase` class of the `unittest` module.
|
|
v2.6.6
Added support to infer return type of typing.cast()
Fix variable lookup's handling of exclusive statements
Fix variable lookup's handling of function parameters
Fix variable lookup's handling of except clause variables
Fix handling of classes with duplicated bases with the same name
|
|
What's New in astroid 2.6.5?
============================
* Fix a crash when there would be a 'TypeError object does not support
item assignment' in the code we parse.
* Fix a crash when a AttributeInferenceError was raised when
failing to find the real name in infer_import_from.
What's New in astroid 2.6.4?
============================
* Fix a crash when a StopIteration was raised when inferring
a faulty function in a context manager.
What's New in astroid 2.6.3?
============================
* 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.
* Fix a crash when the node is a 'Module' in the brain builtin inference
* Fix issues when inferring match variables
* Fix lookup for nested non-function scopes
* Fix issue that ``TypedDict`` instance wasn't callable.
* Add dependency on setuptools and a guard to prevent related exceptions.
|
|
v2.6.2
Fix a crash when the inference of the length of a node failed
Fix unhandled StopIteration during inference, following the implementation
of PEP479 in python 3.7+
|
|
What's New in astroid 2.6.1?
============================
Release date: 2021-06-29
* Fix issue with ``TypedDict`` for Python 3.9+
What's New in astroid 2.6.0?
============================
Release date: 2021-06-22
* 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
* 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.
What's New in astroid 2.5.8?
============================
Release date: 2021-06-07
* Improve support for Pattern Matching
* Add lineno and col_offset for ``Keyword`` nodes and Python 3.9+
* Add global inference cache to speed up inference of long statement blocks
* Add a limit to the total number of nodes inferred indirectly as a result
of inferring some node
|
|
What's New in astroid 2.5.7?
* Fix six.with_metaclass transformation so it doesn't break user defined transformations.
* Fix detection of relative imports.
* Fix inference of instance attributes defined in base classes
* Update `infer_named_tuple` brain to reject namedtuple definitions
that would raise ValueError
* Do not set instance attributes on builtin object()
* Fix some spurious cycles detected in ``context.path`` leading to more cases
that can now be inferred
* Add ``kind`` field to ``Const`` nodes, matching the structure of the built-in ast Const.
The kind field is "u" if the literal is a u-prefixed string, and ``None`` otherwise.
* Fix property inference in class contexts for properties defined on the metaclass
* Update enum brain to fix definition of __members__ for subclass-defined Enums
* Update random brain to fix a crash with inference of some sequence elements
* Fix inference of attributes defined in a base class that is an inner class
* Allow inferring a return value of None for non-abstract empty functions and
functions with no return statements (implicitly returning None)
* scm_setuptools has been added to the packaging.
* Astroid's tags are now the standard form ``vX.Y.Z`` and not ``astroid-X.Y.Z`` anymore.
* Add initial support for Pattern Matching in Python 3.10
|
|
What's New in astroid 2.5.6?
============================
Release Date: 2021-04-25
* Fix retro-compatibility issues with old version of pylint
What's New in astroid 2.5.5?
============================
Release Date: 2021-04-24
* Fixes the discord link in the project urls of the package.
What's New in astroid 2.5.4?
============================
Release Date: 2021-04-24
* The packaging is now done via setuptools exclusively. ``doc``, ``tests``, and ``Changelog`` are
not packaged anymore - reducing the size of the package greatly.
* Debian packaging is now (officially) done in https://salsa.debian.org/python-team/packages/astroid.
* ``__pkginfo__`` now only contain ``__version__`` (also accessible with ``astroid.__version__``),
other meta-information are still accessible with ``import importlib;metadata.metadata('astroid')``.
* Added inference tip for ``typing.Tuple`` alias
* Fix crash when evaluating ``typing.NamedTuple``
* COPYING was removed in favor of COPYING.LESSER and the latter was renamed to LICENSE to make more apparent
that the code is licensed under LGPLv2 or later.
* Moved from appveyor and travis to Github Actions for continuous integration.
|
|
What's New in astroid 2.5.3?
============================
* Takes into account the fact that subscript inferring for a ClassDef may involve __class_getitem__ method
* Reworks the `collections` and `typing` brain so that `pylint`s acceptance tests are fine.
* Use ``inference_tip`` for ``typing.TypedDict`` brain.
* Fix mro for classes that inherit from typing.Generic
* Add inference tip for typing.Generic and typing.Annotated with ``__class_getitem__``
|
|
What's New in astroid 2.5.2?
* Detects `import numpy` as a valid `numpy` import.
* Iterate over ``Keywords`` when using ``ClassDef.get_children``
|
|
What's New in astroid 2.5.1?
* The ``context.path`` is reverted to a set because otherwise it leads to false positives
for non `numpy` functions.
* Don't transform dataclass ClassVars
* Improve typing.TypedDict inference
* Fix the `Duplicates found in MROs` false positive.
|
|
What's New in astroid 2.5?
* Adds `attr_fset` in the `PropertyModel` class.
* Remove support for Python 3.5.
* Remove the runtime dependency on ``six``. The ``six`` brain remains in
astroid.
* Enrich the ``brain_collection`` module so that ``__class_getitem__`` method is added to `deque` for
``python`` version above 3.9.
* The ``context.path`` is now a ``dict`` and the ``context.push`` method
returns ``True`` if the node has been visited a certain amount of times.
* Adds a brain for type object so that it is possible to write `type[int]` in annotation.
* Add ``__class_getitem__`` method to ``subprocess.Popen`` brain under Python 3.9 so that it is seen as subscriptable by pylint.
* Adds `degrees`, `radians`, which are `numpy ufunc` functions, in the `numpy` brain. Adds `random` function in the `numpy.random` brain.
* Fix deprecated importlib methods
* Fix a crash in inference caused by `Uninferable` container elements
* Add `python 3.9` support.
* The flat attribute of ``numpy.ndarray`` is now inferred as an ``numpy.ndarray`` itself.
It should be a ``numpy.flatiter`` instance, but this class is not yet available in the numpy brain.
* Fix a bug for dunder methods inference of function objects
* Fixes a bug in the signature of the ``ndarray.__or__`` method,
in the ``brain_numpy_ndarray.py`` module.
* 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 a ``numpy.ndarray``
* Added a brain for ``sqlalchemy.orm.session``
* Separate string and bytes classes patching
* Prevent recursion error for self referential length calls
* Added missing methods to the brain for ``mechanize``, to fix pylint false positives
* Added more supported parameters to ``subprocess.check_output``
* Fix recursion errors with pandas
* Added exception inference for `UnicodeDecodeError`
* `FunctionDef.is_generator` properly handles `yield` nodes in `If` tests
* Fixed exception-chaining error messages.
* Fix failure to infer base class type with multiple inheritance and qualified names
* Fix interpretation of ``six.with_metaclass`` class definitions.
* Reduce memory usage of astroid's module cache.
* Remove dependency on `imp`.
* Do not crash when encountering starred assignments in enums.
* Fix a crash in functools.partial inference when the arguments cannot be determined
* Fix a crash caused by a lookup of a monkey-patched method
* ``is_generator`` correctly considers `Yield` nodes in `AugAssign` nodes
This fixes a false positive with the `assignment-from-no-return` pylint check.
* 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.
|
|
|
|
What's New in astroid 2.4.2?
* `FunctionDef.is_generator` properly handles `yield` nodes in `While` tests
* Properly construct the arguments of infered property descriptors
|
|
What's New in astroid 2.4.1?
* Handle the case where the raw builder fails to retrieve the ``__all__`` attribute
* Restructure the AST parsing heuristic to always pick the same module
* Changed setup.py to work with [distlib](https://pypi.org/project/distlib)
* Do not crash with SyntaxError when parsing namedtuples with invalid label
* Protect against ``infer_call_result`` failing with `InferenceError` in `Super.getattr()`
What's New in astroid 2.4.0?
* Expose a ast_from_string method in AstroidManager, which will accept
source code as a string and return the corresponding astroid object
* ``BoundMethod.implicit_parameters`` returns a proper value for ``__new__``
* Allow slots added dynamically to a class to still be inferred
* Allow `FunctionDef.getattr` to look into both instance attrs and special attributes
* Infer qualified ``classmethod`` as a classmethod.
* Prevent a recursion error to happen when inferring the declared metaclass of a class
* Raise ``AttributeInferenceError`` when ``getattr()`` receives an empty name
* Prevent a recursion error for self reference variables and `type()` calls.
* Do not infer the first argument of a staticmethod in a metaclass as the class itself
* ``NodeNG.bool_value()`` gained an optional ``context`` parameter
We 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.
* Pass a context argument to ``astroid.Arguments`` to prevent recursion errors
* Better inference of class and static methods decorated with custom methods
* Reverse the order of decorators for `infer_subscript`
`path_wrapper` needs to come first, followed by `raise_if_nothing_inferred`,
otherwise we won't handle `StopIteration` correctly.
* Prevent a recursion error when inferring self-referential variables without definition
* Numpy `datetime64.astype` return value is inferred as a `ndarray`.
* Skip non ``Assign`` and ``AnnAssign`` nodes from enum reinterpretation
* Numpy ``ndarray`` attributes ``imag`` and ``real`` are now inferred as ``ndarray``.
* Added a call to ``register_transform`` for all functions of the ``brain_numpy_core_multiarray``
module in case the current node is an instance of ``astroid.Name``
* Use the parent of the node when inferring aug assign nodes instead of the statement
* Added some functions to the ``brain_numpy_core_umath`` module
* Added some functions of the ``numpy.core.multiarray`` module
* All the ``numpy ufunc`` functions derived now from a common class that
implements the specific ``reduce``, ``accumulate``, ``reduceat``,
``outer`` and ``at`` methods.
* ``nodes.Const.itered`` returns a list of ``Const`` nodes, not strings
* The ``shape`` attribute of a ``numpy ndarray`` is now a ``ndarray``
* Don't ignore special methods when inspecting gi classes
* 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 the `ast` library. We do not want to completely crash on those
invalid type comments.
* 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's ``boundnode``,
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 the ``self`` to point to it instead of pointing
to the parent class.
* 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 in ``pylint``.
* Add more supported parameters to ``subprocess.check_output``
* Infer args unpacking of ``self``
Certain stdlib modules use ``*args`` to encapsulate
the ``self`` parameter, which results in uninferable
instances given we rely on the presence of the ``self``
argument to figure out the instance where we should be
setting attributes.
* 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.
* 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`
* Properly analyze CFFI compiled extensions.
|
|
|
|
What's New in astroid 2.3.3?
* Relaxed `six` dependency.
|
|
|
|
What's New in astroid 2.3.2?
* All type comments have as parent the corresponding `astroid` node
Until now they had as parent the builtin `ast` node which meant
we were operating with primitive objects instead of our own.
* Pass an inference context to `metaclass()` when inferring an object type
This should prevent a bunch of recursion errors happening in pylint.
Also refactor the inference of `IfExp` nodes to use separate contexts
for each potential branch.
|
|
What's New in astroid 2.3.1?
* 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 of `astroid`, annotated assign nodes were
allowed to be retrieved via `getattr()` but that no longer happens
with the latest `astroid` release, as those attribute are not actual
attributes, but rather virtual ones, thus an operation such as `getattr()`
does not make sense for them.
* Update attr brain to partly understand annotated attributes
What's New in astroid 2.3.0?
* Add a brain tip for ``subprocess.check_output``
* Remove NodeNG.nearest method because of lack of usage in astroid and pylint.
* Allow importing wheel files.
* Annotated AST follows PEP8 coding style when converted to string.
* Fix a bug where defining a class using type() could cause a DuplicateBasesError.
* 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``
* ``assert`` only functions are properly inferred as returning ``None``
* Add support for Python 3.8's `NamedExpr` nodes, which is part of assignment expressions.
* 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`.
* Drop a superfluous and wrong callcontext when inferring the result of a context manager
* ``igetattr`` raises ``InferenceError`` on re-inference of the same object
This prevents ``StopIteration`` from leaking when we encounter the same
object in the current context, which could result in various ``RuntimeErrors``
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.
* Variable annotations can no longer be retrieved with `ClassDef.getattr`
Unless they have an attached value, class variable annotations can no longer
be retrieved with `ClassDef.getattr.`
* Improved builtin inference for ``tuple``, ``set``, ``frozenset``, ``list`` and ``dict``
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.
* The last except handler wins when inferring variables bound in an except handler.
* ``threading.Lock.locked()`` is properly recognized as a member of ``threading.Lock``
* Fix recursion error involving ``len`` and self referential attributes
* Can access per argument type comments through new ``Arguments.type_comment_args`` attribute.
* Fix being unable to access class attributes on a NamedTuple.
* Fixed being unable to find distutils submodules by name when in a virtualenv.
|
|
What's New in astroid 2.2.5?
* The last except handler wins when inferring variables bound in an except handler.
|
|
What's New in astroid 2.2.4?
* Latest typed_ast gets installed for all CPython versions.
|
|
What's New in astroid 2.2.3?
* Replace any with uninferable when returning values from numpy transform
Turns out that this was conflicting with the any builtin, while the original
intention was to return a value that cannot be inferred, until we have support
for types.
This should fix a couple of false positives on pylint's side where the return
value of numpy functions was considered to be itself a function.
|
|
What's New in astroid 2.2.2?
* Generated proper environment markers for installing typed-ast.
What's New in astroid 2.2.1?
* Make sure to infer the arguments to the slice() builtin
* Correctly instantiate exception instances when inferring their attributes with objectmodel
|
|
What's New in astroid 2.2.0?
* Fix a bug concerning inference of calls to numpy function that should not return Tuple or List instances.
* typed_ast gets installed for Python 3.7, meaning type comments can now work on 3.7.
* Fix a bug concerning inference of unary operators on numpy types.
* Fix a crash with typing.NamedTuple and empty fields.
* Add a proper strerror inference to the OSError exceptions.
* Support non-const nodes as values of Enum attributes.
* Fix a crash in the enum brain tip caused by non-assign members in class definitions.
* brain_numpy returns an undefined type for numpy methods to avoid assignment-from-no-return
* Fix a bug where a call to a function that has been previously called via
functools.partial was wrongly inferred
* Fix a recursion error caused by inferring the slice builtin.
* Remove the restriction that "old style classes" cannot have a MRO.
This does not make sense any longer given that we run against Python 3
code.
* Added more builtin exceptions attributes.
* Add a registry for builtin exception models.
* Add brain tips for http.client.
* Prevent crashing when processing enums with mixed single and double quotes.
* typing types have the __args__ property.
* Fix a bug where an Attribute used as a base class was triggering a crash
* Added special support for enum.IntFlag
* Extend detection of data classes defined with attr
* Fix typo in description for brain_attrs
|
|
What's New in astroid 2.1.0?
* threading.Lock.acquire has the timeout parameter now.
* Pass parameters by keyword name when inferring sequences.
* Correct line numbering for f-strings for complex embedded expressions
When a f-string contained a complex expression, such as an attribute access,
we weren't cloning all the subtree of the f-string expression for attaching the correct
line number. This problem is coming from the builtin AST parser which gives for the f-string
and for its underlying elements the line number 1, but this is causing all sorts of bugs and
problems in pylint, which expects correct line numbering.
* Add support for argparse.Namespace
* async functions are now inferred as AsyncGenerator when inferring their call result.
* Filter out Uninferable when inferring the call result result of a class with an uninferable __call__ method.
* Make compatible with AST changes in Python 3.8.
* Subscript inference (e.g. "a[i]") now pays attention to multiple inferred values for value
(e.g. "a") and slice (e.g. "i")
|
|
2.0.4:
Make sure that assign nodes can find ``yield`` statements in their values
2.0.3:
The environment markers for PyPy were invalid.
|
|
What's New in astroid 2.0.2?
* Stop repeat inference attempt causing a RuntimeError in Python3.7
* infer_call_result can raise InferenceError so make sure to handle that for the call sites
where it is used
infer_call_result started recently to raise InferenceError for objects for which it
could not find any returns. Previously it was silently raising a StopIteration,
which was especially leaking when calling builtin methods.
Since it is after all an inference method, it is expected that it
could raise an InferenceError rather than returning nothing.
|
|
2.0.1:
Released to clear an old wheel package on PyPI
|
|
astroid 2.0:
* String representation of nodes takes in account precedence and associativity rules of operators.
* Fix loading files with modutils.load_from_module when
the path that contains it in sys.path is a symlink and
the file is contained in a symlinked folder.
* Reworking of the numpy brain dealing with numerictypes
(use of inspect module to determine the class hierarchy of
numpy.core.numerictypes module)
* Added inference support for starred nodes in for loops
* Support unpacking for dicts in assignments
* Add support for inferring functools.partial
* Inference support for dict.fromkeys
* int() builtin is inferred as returning integers.
* str() builtin is inferred as returning strings.
* DescriptorBoundMethod has the correct number of arguments defined.
* Improvement of the numpy numeric types definition.
* Subclasses of *property* are now interpreted as properties
* AsStringRegexpPredicate has been removed.
Use transform predicates instead of it.
* Switched to using typed_ast for getting access to type comments
As a side effect of this change, some nodes gained a new type_annotation attribute,
which, if the type comments were correctly parsed, should contain a node object
with the corresponding objects from the type comment.
* typing.X[...] and typing.NewType are inferred as classes instead of instances.
* Module.__path__ is now a list
It used to be a string containing the path, but it doesn't reflect the situation
on Python, where it is actually a list.
* Fix a bug with namespace package's __path__ attribute.
* Added brain tips for random.sample
* Add brain tip for issubclass builtin
* Fix submodule imports from six
* Fix missing __module__ and __qualname__ from class definition locals
* Fix a crash when __annotations__ access a parent's __init__ that does not have arguments
* Fix multiple objects sharing the same InferenceContext.path causing uninferable results
* Fix improper modification of col_offset, lineno upon inference of builtin functions
* Subprocess.Popen brain now knows of the args member
* add move_to_end method to collections.OrderedDict brain
* Include new hashlib classes added in python 3.6
* Fix RecursionError for augmented assign
* Add missing attrs special attribute
* Inference now understands the 'isinstance' builtin
* Stop duplicate nodes with the same key values
from appearing in dictionaries from dictionary unpacking.
* Fix contextlib.contextmanager inference for nested context managers
* Implement inference for len builtin
* Add qname method to Super object preventing potential errors in upstream
pylint
* Stop astroid from getting stuck in an infinite loop if a function shares
its name with its decorator
* Fix issue with inherited __call__ improperly inferencing self
* Fix __call__ precedence for classes with custom metaclasses
* Limit the maximum amount of interable result in an NodeNG.infer() call to
100 by default for performance issues with variables with large amounts of
possible values.
The max inferable value can be tuned by setting the max_inferable_values flag on
astroid.MANAGER.
|