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
7c0240f1
Commit
7c0240f1
authored
Jul 24, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e.g. -> e.g.,
parent
c2aa9fba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
Doc/ref/ref1.tex
Doc/ref/ref1.tex
+1
-1
Doc/ref/ref2.tex
Doc/ref/ref2.tex
+4
-4
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+3
-2
Doc/ref/ref4.tex
Doc/ref/ref4.tex
+1
-1
Doc/ref/ref5.tex
Doc/ref/ref5.tex
+7
-7
No files found.
Doc/ref/ref1.tex
View file @
7c0240f1
...
...
@@ -71,7 +71,7 @@ In lexical definitions (as the example above), two more conventions
are used: Two literal characters separated by three dots mean a choice
of any single character in the given (inclusive) range of
\ASCII
{}
characters. A phrase between angular brackets (
\code
{
<...>
}
) gives an
informal description of the symbol defined; e.g. this could be used
informal description of the symbol defined; e.g.
,
this could be used
to describe the notion of `control character' if needed.
\index
{
lexical definitions
}
\index
{
ASCII@
\ASCII
{}}
...
...
Doc/ref/ref2.tex
View file @
7c0240f1
...
...
@@ -38,7 +38,7 @@ A Python program is divided into a number of \emph{logical lines}.
The end of
a logical line is represented by the token NEWLINE. Statements cannot
cross logical line boundaries except where NEWLINE is allowed by the
syntax (e.g. between statements in compound statements).
syntax (e.g.
,
between statements in compound statements).
A logical line is constructed from one or more
\emph
{
physical lines
}
by following the explicit or implicit
\emph
{
line joining
}
rules.
\index
{
logical line
}
...
...
@@ -455,7 +455,7 @@ definitions:
\begin{verbatim}
floatnumber: pointfloat | exponentfloat
pointfloat: [intpart] fraction | intpart "."
exponentfloat: (
intpart
| pointfloat) exponent
exponentfloat: (
nonzerodigit digit*
| pointfloat) exponent
intpart: nonzerodigit digit* | "0"
fraction: "." digit+
exponent: ("e"|"E") ["+"|"-"] digit+
...
...
@@ -487,10 +487,10 @@ An imaginary literals yields a complex number with a real part of
0.0. Complex numbers are represented as a pair of floating point
numbers and have the same restrictions on their range. To create a
complex number with a nonzero real part, add a floating point number
to it, e.g.
\code
{
(3+4j)
}
. Some examples of imaginary literals:
to it, e.g.
,
\code
{
(3+4j)
}
. Some examples of imaginary literals:
\begin{verbatim}
3.14j 10.j 10
j
.001j 1e100j 3.14e-10j
3.14j 10.j 10
j
.001j 1e100j 3.14e-10j
\end{verbatim}
...
...
Doc/ref/ref3.tex
View file @
7c0240f1
...
...
@@ -810,7 +810,8 @@ part of the instance, e.g., ``\code{BaseClass.__init__(self, [args...])}''.
\item
[{\tt __del__(self)}]
Called when the instance is about to be destroyed. If a base class
Called when the instance is about to be destroyed. This is also
called a destructor
\index
{
destructor
}
. If a base class
has a
\method
{__
del
__
()
}
method, the derived class's
\method
{__
del
__
()
}
method
must explicitly call it to ensure proper deletion of the base class
part of the instance. Note that it is possible (though not recommended!)
...
...
@@ -1215,7 +1216,7 @@ the other type here).
\strong
{
Coercion rules
}
: to evaluate
\var
{
x
}
\var
{
op
}
\var
{
y
}
, the
following steps are taken (where
\method
{__
op
__
()
}
and
\method
{__
rop
__
()
}
are the method names corresponding to
\var
{
op
}
,
e.g. if var
{
op
}
is `
\code
{
+
}
',
\method
{__
add
__
()
}
and
e.g.
,
if var
{
op
}
is `
\code
{
+
}
',
\method
{__
add
__
()
}
and
\method
{__
radd
__
()
}
are used). If an exception occurs at any point,
the evaluation is abandoned and exception handling takes over.
...
...
Doc/ref/ref4.tex
View file @
7c0240f1
...
...
@@ -12,7 +12,7 @@ body. Some code blocks (like modules) are normally executed only once, others
(like function bodies) may be executed many times. Code blocks may
textually contain other code blocks. Code blocks may invoke other
code blocks (that may or may not be textually contained in them) as
part of their execution, e.g. by invoking (calling) a function.
part of their execution, e.g.
,
by invoking (calling) a function.
\index
{
code block
}
\indexii
{
code
}{
block
}
...
...
Doc/ref/ref5.tex
View file @
7c0240f1
...
...
@@ -36,7 +36,7 @@ following coercions are applied:
is necessary.
\end{itemize}
Some additional rules apply for certain operators (e.g. a string left
Some additional rules apply for certain operators (e.g.
,
a string left
argument to the `
\%
' operator). Extensions can define their own
coercions.
\section
{
Atoms
}
...
...
@@ -216,7 +216,7 @@ involved).
(In particular, converting a string adds quotes around it and converts
``funny'' characters to escape sequences that are safe to print.)
It is illegal to attempt to convert recursive objects (e.g. lists or
It is illegal to attempt to convert recursive objects (e.g.
,
lists or
dictionaries that contain a reference to themselves, directly or
indirectly.)
\obindex
{
recursive
}
...
...
@@ -248,7 +248,7 @@ attributeref: primary "." identifier
\end{verbatim}
The primary must evaluate to an object of a type that supports
attribute references, e.g. a module or a list. This object is then
attribute references, e.g.
,
a module or a list. This object is then
asked to produce the attribute whose name is the identifier. If this
attribute is not available, the exception
\exception
{
AttributeError
}
\exindex
{
AttributeError
}
is raised.
...
...
@@ -361,7 +361,7 @@ respectively, substituting \code{None} for missing expressions.
\subsection
{
Calls
}
\label
{
calls
}
\index
{
call
}
A call calls a callable object (e.g. a function) with a possibly empty
A call calls a callable object (e.g.
,
a function) with a possibly empty
series of arguments:
\obindex
{
callable
}
...
...
@@ -567,7 +567,7 @@ The \code{\%} (modulo) operator yields the remainder from the
division of the first argument by the second. The numeric arguments
are first converted to a common type. A zero right argument raises
the
\exception
{
ZeroDivisionError
}
exception. The arguments may be floating
point numbers, e.g.
\code
{
3.14
\%
0.7
}
equals
\code
{
0.34
}
(since
point numbers, e.g.
,
\code
{
3.14
\%
0.7
}
equals
\code
{
0.34
}
(since
\code
{
3.14
}
equals
\code
{
4*0.7 + 0.34
}
.) The modulo operator always
yields a result with the same sign as its second operand (or zero);
the absolute value of the result is strictly smaller than the second
...
...
@@ -663,7 +663,7 @@ comp_operator: "<"|">"|"=="|">="|"<="|"<>"|"!="|"is" ["not"]|["not"] "in"
Comparisons yield integer values:
\code
{
1
}
for true,
\code
{
0
}
for false.
Comparisons can be chained arbitrarily, e.g.
\code
{
x < y <= z
}
is
Comparisons can be chained arbitrarily, e.g.
,
\code
{
x < y <= z
}
is
equivalent to
\code
{
x < y and y <= z
}
, except that
\code
{
y
}
is
evaluated only once (but in both cases
\code
{
z
}
is not evaluated at all
when
\code
{
x < y
}
is found to be false).
...
...
@@ -789,7 +789,7 @@ This is sometimes useful, e.g., if \code{s} is a string that should be
replaced by a default value if it is empty, the expression
\code
{
s or 'foo'
}
yields the desired value. Because
\keyword
{
not
}
has to
invent a value anyway, it does not bother to return a value of the
same type as its argument, so e.g.
\code
{
not 'foo'
}
yields
\code
{
0
}
,
same type as its argument, so e.g.
,
\code
{
not 'foo'
}
yields
\code
{
0
}
,
not
\code
{
''
}
.)
Lambda forms (lambda expressions) have the same syntactic position as
...
...
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