Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove another thing from the tests and clarify whatsnew
  • Loading branch information
AlexWaygood committed May 26, 2024
commit 40b596553653941ec4a349deb503e075fe557439
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