Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d68442b1
Commit
d68442b1
authored
Sep 21, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lots of minor fixes, many suggested by Detlef Lannert
<lannert@uni-duesseldorf.de>.
parent
0bb0a90b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Doc/ref/ref6.tex
Doc/ref/ref6.tex
+8
-7
No files found.
Doc/ref/ref6.tex
View file @
d68442b1
...
...
@@ -266,11 +266,11 @@ target: identifier | "(" target_list ")" | "[" target_list "]"
(See section
\ref
{
primaries
}
for the syntax definitions for the last
three symbols.)
An augmented assignment evaluates the target (which, unlike
with
normal
assignment statements, cannot be a
tuple) and the expression list, performs
the binary operation specific to the type of assignment on the two operands,
and assigns the result to the original target. The target is only evaluated
once.
An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be a
n unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original
target. The target is only evaluated
once.
An augmented assignment expression like
\code
{
x += 1
}
can be rewritten as
\code
{
x = x + 1
}
to achieve a similar, but not exactly equal effect. In the
...
...
@@ -370,9 +370,10 @@ exception is raised.
\exindex
{
RuntimeError
}
\keyword
{
print
}
also has an extended form, defined as
\index
{
extended print statement
}
\begin{verbatim}
print
_
stmt:
'>>' expression [ (',' expression)+ [','] ] )
print
_
stmt:
"print" ">>" expression [ ("," expression)+ [","] ]
\end{verbatim}
In this form, the first expression after the
\keyword
{
>>
}
must
...
...
@@ -559,7 +560,7 @@ see below.
The
\keyword
{
from
}
form does not bind the module name: it goes through the
list of identifiers, looks each one of them up in the module found in step
(1), and binds the name in the local namespace to the object thus found.
Like
with the first form of
\keyword
{
import
}
, an alternate local name can be
As
with the first form of
\keyword
{
import
}
, an alternate local name can be
supplied by specifying "
\keyword
{
as
}
localname". If a name is not found,
\exception
{
ImportError
}
is raised. If the list of identifiers is replaced
by a star (
\samp
{
*
}
), all names defined in the module are bound, except
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment