Kaydet (Commit) 512bb72f authored tarafından Fred Drake's avatar Fred Drake

As pointed out by Denis S. Otkidach <den@analyt.chem.msu.ru>, xrange()

returns an xrange object, not a range object, despite the name of the
source file they're implemented in.

In the list of comparison operators, list != before <>, since <> is
described as obsolescent.
üst a0073825
...@@ -105,8 +105,8 @@ This table summarizes the comparison operations: ...@@ -105,8 +105,8 @@ This table summarizes the comparison operations:
\lineiii{>}{strictly greater than}{} \lineiii{>}{strictly greater than}{}
\lineiii{>=}{greater than or equal}{} \lineiii{>=}{greater than or equal}{}
\lineiii{==}{equal}{} \lineiii{==}{equal}{}
\lineiii{<>}{not equal}{(1)}
\lineiii{!=}{not equal}{(1)} \lineiii{!=}{not equal}{(1)}
\lineiii{<>}{not equal}{(1)}
\lineiii{is}{object identity}{} \lineiii{is}{object identity}{}
\lineiii{is not}{negated object identity}{} \lineiii{is not}{negated object identity}{}
\end{tableiii} \end{tableiii}
...@@ -313,7 +313,7 @@ division by \code{pow(2, \var{n})} without overflow check. ...@@ -313,7 +313,7 @@ division by \code{pow(2, \var{n})} without overflow check.
\subsection{Sequence Types \label{typesseq}} \subsection{Sequence Types \label{typesseq}}
There are six sequence types: strings, Unicode strings, lists, There are six sequence types: strings, Unicode strings, lists,
tuples, buffers, and ranges. tuples, buffers, and xrange objects.
Strings literals are written in single or double quotes: Strings literals are written in single or double quotes:
\code{'xyzzy'}, \code{"frobozz"}. See chapter 2 of the \code{'xyzzy'}, \code{"frobozz"}. See chapter 2 of the
...@@ -327,9 +327,9 @@ or without enclosing parentheses, but an empty tuple must have the ...@@ -327,9 +327,9 @@ or without enclosing parentheses, but an empty tuple must have the
enclosing parentheses, e.g., \code{a, b, c} or \code{()}. A single enclosing parentheses, e.g., \code{a, b, c} or \code{()}. A single
item tuple must have a trailing comma, e.g., \code{(d,)}. Buffers are item tuple must have a trailing comma, e.g., \code{(d,)}. Buffers are
not directly support by Python syntax, but can created by calling the not directly support by Python syntax, but can created by calling the
builtin function \function{buffer()}.\bifuncindex{buffer} Ranges are builtin function \function{buffer()}.\bifuncindex{buffer} XRanges
similar to buffers in that there is no specific syntax to create them, objects are similar to buffers in that there is no specific syntax to
but they are created using the \function{xrange()} create them, but they are created using the \function{xrange()}
function.\bifuncindex{xrange} function.\bifuncindex{xrange}
\indexii{sequence}{types} \indexii{sequence}{types}
\indexii{string}{type} \indexii{string}{type}
...@@ -337,6 +337,7 @@ function.\bifuncindex{xrange} ...@@ -337,6 +337,7 @@ function.\bifuncindex{xrange}
\indexii{buffer}{type} \indexii{buffer}{type}
\indexii{tuple}{type} \indexii{tuple}{type}
\indexii{list}{type} \indexii{list}{type}
\indexii{xrange}{type}
Sequence types support the following operations. The \samp{in} and Sequence types support the following operations. The \samp{in} and
\samp{not in} operations have the same priorities as the comparison \samp{not in} operations have the same priorities as the comparison
...@@ -638,18 +639,18 @@ Additional string operations are defined in standard module ...@@ -638,18 +639,18 @@ Additional string operations are defined in standard module
\refstmodindex{re} \refstmodindex{re}
\subsubsection{Range Type \label{typesseq-range}} \subsubsection{XRange Type \label{typesseq-xrange}}
The range\indexii{range}{type} type is an immutable sequence which is The xrange\indexii{xrange}{type} type is an immutable sequence which is
commonly used for looping. The advantage of the range type is that a commonly used for looping. The advantage of the xrange type is that an
range object will always take the same amount of memory, no matter the xrange object will always take the same amount of memory, no matter the
size of the range it represents. There are no consistent performance size of the range it represents. There are no consistent performance
advantages. advantages.
Range objects behave like tuples, and offer a single method: XRange objects behave like tuples, and offer a single method:
\begin{methoddesc}[range]{tolist}{} \begin{methoddesc}[xrange]{tolist}{}
Return a list object which represents the same values as the range Return a list object which represents the same values as the xrange
object. object.
\end{methoddesc} \end{methoddesc}
...@@ -1112,8 +1113,8 @@ attribute. ...@@ -1112,8 +1113,8 @@ attribute.
\subsubsection{Internal Objects \label{typesinternal}} \subsubsection{Internal Objects \label{typesinternal}}
See the \citetitle[../ref/ref.html]{Python Reference Manual} for this See the \citetitle[../ref/ref.html]{Python Reference Manual} for this
information. It describes code objects, stack frame objects, information. It describes stack frame objects, traceback objects, and
traceback objects, and slice objects. slice objects.
\subsection{Special Attributes \label{specialattrs}} \subsection{Special Attributes \label{specialattrs}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment