Skip to content

Commit b1834be

Browse files
cxzhongCopilot
andauthored
Update src/sage/misc/sageinspect.py
Co-authored-by: Copilot <[email protected]>
1 parent 1f0d9c5 commit b1834be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/misc/sageinspect.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,10 @@ def visit_Constant(self, node):
755755
"""
756756
Visit a Python AST :class:`ast.Constant` node.
757757
758-
Starting from Python 3.8, constants like numbers, strings, booleans,
759-
None, and ellipsis are all represented as Constant nodes instead of
760-
separate node types (Num, Str, NameConstant, etc.).
758+
Note: While :class:`ast.Constant` was introduced in Python 3.8, the legacy node types
759+
(:class:`ast.Num`, :class:`ast.Str`, :class:`ast.NameConstant`, etc.) continued to be
760+
generated for backward compatibility until Python 3.14. Only from Python 3.14 onwards
761+
are all constants represented as :class:`ast.Constant` nodes.
761762
762763
INPUT:
763764

0 commit comments

Comments
 (0)