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
6cb64f9e
Commit
6cb64f9e
authored
Mar 08, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Shortcut" should be "short-circuit".
This closes SF bug #526277.
parent
df708788
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Doc/tut/tut.tex
Doc/tut/tut.tex
+7
-6
No files found.
Doc/tut/tut.tex
View file @
6cb64f9e
...
...
@@ -2039,12 +2039,13 @@ the highest priority, and \code{or} the lowest, so that
course, parentheses can be used to express the desired composition.
The Boolean operators
\code
{
and
}
and
\code
{
or
}
are so-called
\emph
{
shortcut
}
operators: their arguments are evaluated from left to
right, and evaluation stops as soon as the outcome is determined.
E.g., if
\code
{
A
}
and
\code
{
C
}
are true but
\code
{
B
}
is false,
\code
{
A
and B and C
}
does not evaluate the expression C. In general, the
return value of a shortcut operator, when used as a general value and
not as a Boolean, is the last evaluated argument.
\emph
{
short-circuit
}
operators: their arguments are evaluated from
left to right, and evaluation stops as soon as the outcome is
determined. For example, if
\code
{
A
}
and
\code
{
C
}
are true but
\code
{
B
}
is false,
\code
{
A and B and C
}
does not evaluate the
expression
\code
{
C
}
. In general, the return value of a short-circuit
operator, when used as a general value and not as a Boolean, is the
last evaluated argument.
It is possible to assign the result of a comparison or other Boolean
expression to a variable. For example,
...
...
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