COMMENT: This page is being refactored

This chapter explains the meaning of the elements of expressions in Python.

Atoms

Atoms are the most basic elements of expressions. The simplest atoms are identifiers or literals. Subexpressions enclosed in reverse quotes or in parentheses, brackets or braces are also categorized syntactically as atoms.

An atom can be one of:

See syntax-atom.

Arithmetic conversions

When a description of an arithmetic operator below uses a phrase like the numeric arguments are converted to a common type, the arguments are coerced using Python's standard coercion-rules. If both arguments are standard numeric types, the following coercions are applied:

Some additional rules apply for certain operators (e.g., a string left argument to the '%' operator). Extensions can define their own coercions.