]> granicus.if.org Git - python/commitdiff
Add a note explaining that multiplying a sequence with a negative
authorGuido van Rossum <guido@python.org>
Tue, 27 Jan 1998 19:09:43 +0000 (19:09 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 27 Jan 1998 19:09:43 +0000 (19:09 +0000)
number is the same as multiplying it with zero, and yields an empty
sequence.

Doc/lib/libtypes.tex
Doc/libtypes.tex

index ed0ed9b01363c24c45d7c035716a5451b59571fc..6cb66f9fadc32fecf09c723c66cbbbfca4c45ecc 100644 (file)
@@ -330,7 +330,7 @@ equal to \var{x}, else \code{1}}{}
   \hline
   \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{}
   \hline
-  \lineiii{\var{s} * \var{n}{\rm ,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{}
+  \lineiii{\var{s} * \var{n}{\rm ,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{(3)}
   \hline
   \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(1)}
   \lineiii{\var{s}[\var{i}:\var{j}]}{slice of \var{s} from \var{i} to \var{j}}{(1), (2)}
@@ -367,6 +367,10 @@ Notes:
   use \code{0}.  If \var{j} is omitted, use \code{len(\var{s})}.  If
   \var{i} is greater than or equal to \var{j}, the slice is empty.
 
+\item[(3)] Values of \var{n} less than \code{0} are treated as
+  \code{0} (which yields an empty sequence of the same type as
+  \var{s}).
+
 \end{description}
 
 \subsubsection{More String Operations}
index ed0ed9b01363c24c45d7c035716a5451b59571fc..6cb66f9fadc32fecf09c723c66cbbbfca4c45ecc 100644 (file)
@@ -330,7 +330,7 @@ equal to \var{x}, else \code{1}}{}
   \hline
   \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{}
   \hline
-  \lineiii{\var{s} * \var{n}{\rm ,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{}
+  \lineiii{\var{s} * \var{n}{\rm ,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{(3)}
   \hline
   \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(1)}
   \lineiii{\var{s}[\var{i}:\var{j}]}{slice of \var{s} from \var{i} to \var{j}}{(1), (2)}
@@ -367,6 +367,10 @@ Notes:
   use \code{0}.  If \var{j} is omitted, use \code{len(\var{s})}.  If
   \var{i} is greater than or equal to \var{j}, the slice is empty.
 
+\item[(3)] Values of \var{n} less than \code{0} are treated as
+  \code{0} (which yields an empty sequence of the same type as
+  \var{s}).
+
 \end{description}
 
 \subsubsection{More String Operations}