Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="ref.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="ref.html" title='Python Reference Manual' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="simple.html" /> | |
13 | <link rel="prev" href="execmodel.html" /> | |
14 | <link rel="parent" href="ref.html" /> | |
15 | <link rel="next" href="conversions.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>5. Expressions</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="4.2 Exceptions" | |
25 | href="exceptions.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="Python Reference Manual" | |
28 | href="ref.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="5.1 Arithmetic conversions" | |
31 | href="conversions.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Reference Manual</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><img src='../icons/blank.png' | |
38 | border='0' height='32' alt='' width='32' /></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="exceptions.html">4.2 Exceptions</A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="ref.html">Python Reference Manual</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="conversions.html">5.1 Arithmetic conversions</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION007000000000000000000"></A><A NAME="expressions"></A> | |
56 | <a id='l2h-328' xml:id='l2h-328'></a> | |
57 | <BR> | |
58 | 5. Expressions | |
59 | </H1> | |
60 | ||
61 | <P> | |
62 | This chapter explains the meaning of the elements of expressions in | |
63 | Python. | |
64 | ||
65 | <P> | |
66 | <strong>Syntax Notes:</strong> In this and the following chapters, extended | |
67 | BNF<a id='l2h-329' xml:id='l2h-329'></a> notation will be used to describe syntax, not lexical | |
68 | analysis. When (one alternative of) a syntax rule has the form | |
69 | ||
70 | <P> | |
71 | <dl><dd class="grammar"> | |
72 | <div class="productions"> | |
73 | <table> | |
74 | ||
75 | <tr> | |
76 | <td>name</td> | |
77 | <td>::=</td> | |
78 | <td>othername</td></tr> | |
79 | </table> | |
80 | </div> | |
81 | </dd></dl> | |
82 | ||
83 | <P> | |
84 | and no semantics are given, the semantics of this form of <code>name</code> | |
85 | are the same as for <code>othername</code>. | |
86 | <a id='l2h-330' xml:id='l2h-330'></a> | |
87 | ||
88 | <P> | |
89 | ||
90 | <p><br /></p><hr class='online-navigation' /> | |
91 | <div class='online-navigation'> | |
92 | <!--Table of Child-Links--> | |
93 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
94 | ||
95 | <UL CLASS="ChildLinks"> | |
96 | <LI><A href="conversions.html">5.1 Arithmetic conversions</a> | |
97 | <LI><A href="atoms.html">5.2 Atoms</a> | |
98 | <UL> | |
99 | <LI><A href="atom-identifiers.html">5.2.1 Identifiers (Names)</a> | |
100 | <LI><A href="atom-literals.html">5.2.2 Literals</a> | |
101 | <LI><A href="parenthesized.html">5.2.3 Parenthesized forms</a> | |
102 | <LI><A href="lists.html">5.2.4 List displays</a> | |
103 | <LI><A href="genexpr.html">5.2.5 Generator expressions</a> | |
104 | <LI><A href="dict.html">5.2.6 Dictionary displays</a> | |
105 | <LI><A href="string-conversions.html">5.2.7 String conversions</a> | |
106 | </ul> | |
107 | <LI><A href="primaries.html">5.3 Primaries</a> | |
108 | <UL> | |
109 | <LI><A href="attribute-references.html">5.3.1 Attribute references</a> | |
110 | <LI><A href="subscriptions.html">5.3.2 Subscriptions</a> | |
111 | <LI><A href="slicings.html">5.3.3 Slicings</a> | |
112 | <LI><A href="calls.html">5.3.4 Calls</a> | |
113 | </ul> | |
114 | <LI><A href="power.html">5.4 The power operator</a> | |
115 | <LI><A href="unary.html">5.5 Unary arithmetic operations</a> | |
116 | <LI><A href="binary.html">5.6 Binary arithmetic operations</a> | |
117 | <LI><A href="shifting.html">5.7 Shifting operations</a> | |
118 | <LI><A href="bitwise.html">5.8 Binary bit-wise operations</a> | |
119 | <LI><A href="comparisons.html">5.9 Comparisons</a> | |
120 | <LI><A href="Booleans.html">5.10 Boolean operations</a> | |
121 | <LI><A href="lambdas.html">5.11 Lambdas</a> | |
122 | <LI><A href="exprlists.html">5.12 Expression lists</a> | |
123 | <LI><A href="evalorder.html">5.13 Evaluation order</a> | |
124 | <LI><A href="summary.html">5.14 Summary</a> | |
125 | </ul> | |
126 | <!--End of Table of Child-Links--> | |
127 | </div> | |
128 | ||
129 | <DIV CLASS="navigation"> | |
130 | <div class='online-navigation'> | |
131 | <p></p><hr /> | |
132 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
133 | <tr> | |
134 | <td class='online-navigation'><a rel="prev" title="4.2 Exceptions" | |
135 | href="exceptions.html"><img src='../icons/previous.png' | |
136 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
137 | <td class='online-navigation'><a rel="parent" title="Python Reference Manual" | |
138 | href="ref.html"><img src='../icons/up.png' | |
139 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
140 | <td class='online-navigation'><a rel="next" title="5.1 Arithmetic conversions" | |
141 | href="conversions.html"><img src='../icons/next.png' | |
142 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
143 | <td align="center" width="100%">Python Reference Manual</td> | |
144 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
145 | href="contents.html"><img src='../icons/contents.png' | |
146 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
147 | <td class='online-navigation'><img src='../icons/blank.png' | |
148 | border='0' height='32' alt='' width='32' /></td> | |
149 | <td class='online-navigation'><a rel="index" title="Index" | |
150 | href="genindex.html"><img src='../icons/index.png' | |
151 | border='0' height='32' alt='Index' width='32' /></A></td> | |
152 | </tr></table> | |
153 | <div class='online-navigation'> | |
154 | <b class="navlabel">Previous:</b> | |
155 | <a class="sectref" rel="prev" href="exceptions.html">4.2 Exceptions</A> | |
156 | <b class="navlabel">Up:</b> | |
157 | <a class="sectref" rel="parent" href="ref.html">Python Reference Manual</A> | |
158 | <b class="navlabel">Next:</b> | |
159 | <a class="sectref" rel="next" href="conversions.html">5.1 Arithmetic conversions</A> | |
160 | </div> | |
161 | </div> | |
162 | <hr /> | |
163 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
164 | </DIV> | |
165 | <!--End of Navigation Panel--> | |
166 | <ADDRESS> | |
167 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
168 | </ADDRESS> | |
169 | </BODY> | |
170 | </HTML> |