Skip to content
Evergreen Evergreen
Documentation

ast.Num, Str, Bytes, NameConstant and Ellipsis are deprecated

Deprecated. The source gives no day. Replacement: ast.Constant. Source: Python deprecations: pending removal in 3.14.

Check a version:

evergreen check pkg:generic/python

Python deprecates the ast.Num, ast.Str, ast.Bytes, ast.NameConstant and ast.Ellipsis node classes since 3.8; they emit a DeprecationWarning and are listed for removal in 3.14.

Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>

   
Status Deprecated
Severity low
Ecosystem python
Component pkg:generic/python
Affected versions vers:pypi/>=3.8
Date from the source The source gives no day
Replacement ast.Constant
Evidence last seen 2026-10-21
Reviewed 2026-10-21 by arminazimi
Review due 2027-10-21 (365 days after the last review)
Rule ID python.symbol.ast.constant-nodes

Sources

Migration

Constraints

  • Keep the behavior of the call unchanged; check the replacement’s argument and return-type differences.

Steps

  1. Use ast.Constant. Replace each class with ast.Constant and read .value instead of .n, .s or .value of the old node.

Verification

  • python -W error::DeprecationWarning -m pytest: Run the tests with deprecation warnings as errors when pytest is used.

Detected by

The python detector. See Detectors and Compatibility.

Other versions of this product

Same ecosystem

Data

This page is generated from registry/python.json, rule python.symbol.ast.constant-nodes, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.

Last updated