Skip to content

Commit

Permalink
Remove another thing from the tests and clarify whatsnew
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed May 26, 2024
1 parent 1d4634d commit 40b5965
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ ast
* :class:`!ast.Ellipsis`

Use :class:`ast.Constant` instead. As a consequence of these removals,
``visit_Num``, ``visit_Str``, ``visit_Bytes``, ``visit_NameConstant`` and
``visit_Ellipsis`` methods will no longer have any effect on
:class:`ast.NodeVisitor` subclasses; use ``visit_Constant`` instead.
user-defined ``visit_Num``, ``visit_Str``, ``visit_Bytes``,
``visit_NameConstant`` and ``visit_Ellipsis`` methods on custom
:class:`ast.NodeVisitor` subclasses will no longer be called when the
``NodeVisitor`` subclass is visiting an AST. Define ``visit_Constant``
methods instead.

Also, remove the following deprecated properties on :class:`ast.Constant`,
which were present for compatibility with the now-removed AST classes:
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2608,8 +2608,6 @@ def test_source_segment_missing_info(self):


class NodeTransformerTests(ASTTestMixin, unittest.TestCase):
visitor_class = ast.NodeTransformer

def assertASTTransformation(self, tranformer_class,
initial_code, expected_code):
initial_ast = ast.parse(dedent(initial_code))
Expand Down

0 comments on commit 40b5965

Please sign in to comment.