GNU Info

Info Node: (python2.1-ref.info)Literals 2

(python2.1-ref.info)Literals 2


Next: Parenthesized forms Prev: Identifiers Names Up: Atoms
Enter node , (file) or (file)node

Literals
--------

Python supports string literals and various numeric literals:

     literal: stringliteral | integer | longinteger | floatnumber | imagnumber

Evaluation of a literal yields an object of the given type (string,
integer, long integer, floating point number, complex number) with the
given value.  The value may be approximated in the case of floating
point and imaginary (complex) literals.  See section Note: Literals
for details.

All literals correspond to immutable data types, and hence the object's
identity is less important than its value.  Multiple evaluations of
literals with the same value (either the same occurrence in the program
text or a different occurrence) may obtain the same object or a
different object with the same value.


automatically generated by info2www version 1.2.2.9