Skip to content

Remove deprecated nodes #2152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ Release date: TBA

Refs #2141

* Remove deprecated ``Ellipsis``, ``ExtSlice``, ``Index`` nodes.

Refs #2152


What's New in astroid 2.15.5?
=============================
Expand Down
5 changes: 1 addition & 4 deletions astroid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# and we need astroid/scoped_nodes and astroid/node_classes to work. So
# importing with a wildcard would clash with astroid/nodes/scoped_nodes
# and astroid/nodes/node_classes.
from astroid.nodes import ( # pylint: disable=redefined-builtin (Ellipsis)
from astroid.nodes import (
CONST_CLS,
AnnAssign,
Arguments,
Expand Down Expand Up @@ -117,12 +117,10 @@
Dict,
DictComp,
DictUnpack,
Ellipsis,
EmptyNode,
EvaluatedObject,
ExceptHandler,
Expr,
ExtSlice,
For,
FormattedValue,
FunctionDef,
Expand All @@ -132,7 +130,6 @@
IfExp,
Import,
ImportFrom,
Index,
JoinedStr,
Keyword,
Lambda,
Expand Down
5 changes: 1 addition & 4 deletions astroid/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import warnings

from astroid.nodes.node_classes import ( # pylint: disable=redefined-builtin (Ellipsis)
from astroid.nodes.node_classes import (
CONST_CLS,
AnnAssign,
Arguments,
Expand Down Expand Up @@ -34,20 +34,17 @@
DelName,
Dict,
DictUnpack,
Ellipsis,
EmptyNode,
EvaluatedObject,
ExceptHandler,
Expr,
ExtSlice,
For,
FormattedValue,
Global,
If,
IfExp,
Import,
ImportFrom,
Index,
JoinedStr,
Keyword,
List,
Expand Down
11 changes: 1 addition & 10 deletions astroid/nodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# This is the only node we re-export from the private _base_nodes module. This
# is because it was originally part of the public API and hasn't been deprecated.
from astroid.nodes._base_nodes import Statement
from astroid.nodes.node_classes import ( # pylint: disable=redefined-builtin (Ellipsis)
from astroid.nodes.node_classes import (
CONST_CLS,
AnnAssign,
Arguments,
Expand Down Expand Up @@ -43,20 +43,17 @@
DelName,
Dict,
DictUnpack,
Ellipsis,
EmptyNode,
EvaluatedObject,
ExceptHandler,
Expr,
ExtSlice,
For,
FormattedValue,
Global,
If,
IfExp,
Import,
ImportFrom,
Index,
JoinedStr,
Keyword,
List,
Expand Down Expand Up @@ -149,12 +146,10 @@
Dict,
DictComp,
DictUnpack,
Ellipsis,
EmptyNode,
EvaluatedObject,
ExceptHandler,
Expr,
ExtSlice,
For,
FormattedValue,
FunctionDef,
Expand All @@ -164,7 +159,6 @@
IfExp,
Import,
ImportFrom,
Index,
JoinedStr,
Keyword,
Lambda,
Expand Down Expand Up @@ -241,12 +235,10 @@
"Dict",
"DictComp",
"DictUnpack",
"Ellipsis",
"EmptyNode",
"EvaluatedObject",
"ExceptHandler",
"Expr",
"ExtSlice",
"For",
"FormattedValue",
"FunctionDef",
Expand All @@ -258,7 +250,6 @@
"IfExp",
"Import",
"ImportFrom",
"Index",
"JoinedStr",
"Keyword",
"Lambda",
Expand Down
30 changes: 0 additions & 30 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2035,16 +2035,6 @@ def _get_yield_nodes_skip_lambdas(self):
yield from self.value._get_yield_nodes_skip_lambdas()


class Ellipsis(_base_nodes.NoChildrenNode): # pylint: disable=redefined-builtin
"""Class representing an :class:`ast.Ellipsis` node.

An :class:`Ellipsis` is the ``...`` syntax.

Deprecated since v2.6.0 - Use :class:`Const` instead.
Will be removed with the release v2.7.0
"""


class EmptyNode(_base_nodes.NoChildrenNode):
"""Holds an arbitrary object in the :attr:`LocalsDictNodeNG.locals`."""

Expand Down Expand Up @@ -2149,16 +2139,6 @@ def catch(self, exceptions: list[str] | None) -> bool:
return any(node.name in exceptions for node in self.type._get_name_nodes())


class ExtSlice(NodeNG):
"""Class representing an :class:`ast.ExtSlice` node.

An :class:`ExtSlice` is a complex slice expression.

Deprecated since v2.6.0 - Now part of the :class:`Subscript` node.
Will be removed with the release of v2.7.0
"""


class For(
_base_nodes.MultiLineWithElseBlockNode,
_base_nodes.AssignTypeNode,
Expand Down Expand Up @@ -2644,16 +2624,6 @@ def __init__(
)


class Index(NodeNG):
"""Class representing an :class:`ast.Index` node.

An :class:`Index` is a simple subscript.

Deprecated since v2.6.0 - Now part of the :class:`Subscript` node.
Will be removed with the release of v2.7.0
"""


class Keyword(NodeNG):
"""Class representing an :class:`ast.keyword` node.

Expand Down
9 changes: 0 additions & 9 deletions doc/api/astroid.nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ Nodes
astroid.nodes.Dict
astroid.nodes.DictComp
astroid.nodes.DictUnpack
astroid.nodes.Ellipsis
astroid.nodes.EmptyNode
astroid.nodes.ExceptHandler
astroid.nodes.Expr
astroid.nodes.ExtSlice
astroid.nodes.For
astroid.nodes.FormattedValue
astroid.nodes.FunctionDef
Expand All @@ -51,7 +49,6 @@ Nodes
astroid.nodes.IfExp
astroid.nodes.Import
astroid.nodes.ImportFrom
astroid.nodes.Index
astroid.nodes.JoinedStr
astroid.nodes.Keyword
astroid.nodes.Lambda
Expand Down Expand Up @@ -145,16 +142,12 @@ Nodes

.. autoclass:: astroid.nodes.DictUnpack

.. autoclass:: astroid.nodes.Ellipsis

.. autoclass:: astroid.nodes.EmptyNode

.. autoclass:: astroid.nodes.ExceptHandler

.. autoclass:: astroid.nodes.Expr

.. autoclass:: astroid.nodes.ExtSlice

.. autoclass:: astroid.nodes.For

.. autoclass:: astroid.nodes.FormattedValue
Expand All @@ -173,8 +166,6 @@ Nodes

.. autoclass:: astroid.nodes.ImportFrom

.. autoclass:: astroid.nodes.Index

.. autoclass:: astroid.nodes.JoinedStr

.. autoclass:: astroid.nodes.Keyword
Expand Down