63 EXPRESSIONS 6.1 Arithmetic conversions 6.2 Atoms This chapter explains the meaning of the elements of expressions in Python. Syntax Notes: In this and the following chapters, extended BNF notation will be used to describe syntax, not lexical analysis. When (one alternative of) a syntax rule has the form and no semantics are given, the semantics of this form of$_{name}$are the same as for$_{othername}$. name ::= othername When a description of an arithmetic operator below uses the phrase “the numeric arguments are converted to a common type”, this means that the operator implementation for built-in types works as follows: Some additional rules apply for certain operators (e.g., a string as a left argument to the ‘%’ operator). Extensions must define their own conversion behavior. Atoms are the most basic elements of expressions. The simplest atoms are identifiers or literals. Forms enclosed in parentheses, brackets or braces are also categorized syntactically as atoms. The syntax for atoms is: • otherwise, both must be integers and no conversion is necessary. • otherwise, if either argument is a floating point number, the other is converted to floating point; • If either argument is a complex number, the other is converted to complex; atom ::= identifier | literal | enclosure enclosure ::= parenth_form | list_display | dict_display | set_display | generator_expression | yield_atom CHAPTER SIX