Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6ef032

Browse files
committed
* Doc/libtypes.tex: fix typo in table of list methods; clarify
truncation behavior of floating point formatting * Doc/ref3.tex: clarify defaults for __repr__, __cmp__ and __str__; correct (some) descriptions of class constructors
1 parent 7faf67c commit e6ef032

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

Doc/lib/libtypes.tex

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,14 @@ \subsubsection{More String Operations.}
307307
\code{\%s} conversions don't assume that \code{'\\0'} is the end of
308308
the string.
309309

310-
For safety reasons, huge floating point precisions are truncated;
311-
\code{\%f} conversions for huge numbers are replaced by
312-
\code{\%g} conversions. All other errors raise exceptions.
310+
For safety reasons, floating point precisions are clipped to 50;
311+
\code{\%f} conversions for numbers whose absolute value is over 1e25
312+
are replaced by \code{\%g} conversions.%
313+
\footnote{These numbers are fairly arbitrary. They are intended to
314+
avoid printing endless strings of meaningless digits without hampering
315+
correct use and without having to know the exact precision of floating
316+
point values on a particular machine.}
317+
All other errors raise exceptions.
313318

314319
If the right argument is a dictionary (or any kind of mapping), then
315320
the formats in the string must have a parenthesized key into that
@@ -350,7 +355,7 @@ \subsubsection{Mutable Sequence Types.}
350355
\lineiii{del \var{s}[\var{i}:\var{j}]}
351356
{same as \code{\var{s}[\var{i}:\var{j}] = []}}{}
352357
\lineiii{\var{s}.append(\var{x})}
353-
{same as \code{\var{s}[len(\var{x}):len(\var{x})] = [\var{x}]}}{}
358+
{same as \code{\var{s}[len(\var{s}):len(\var{s})] = [\var{x}]}}{}
354359
\lineiii{\var{s}.count(\var{x})}
355360
{return number of \var{i}'s for which \code{\var{s}[\var{i}] == \var{x}}}{}
356361
\lineiii{\var{s}.index(\var{x})}

Doc/libtypes.tex

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,14 @@ \subsubsection{More String Operations.}
307307
\code{\%s} conversions don't assume that \code{'\\0'} is the end of
308308
the string.
309309

310-
For safety reasons, huge floating point precisions are truncated;
311-
\code{\%f} conversions for huge numbers are replaced by
312-
\code{\%g} conversions. All other errors raise exceptions.
310+
For safety reasons, floating point precisions are clipped to 50;
311+
\code{\%f} conversions for numbers whose absolute value is over 1e25
312+
are replaced by \code{\%g} conversions.%
313+
\footnote{These numbers are fairly arbitrary. They are intended to
314+
avoid printing endless strings of meaningless digits without hampering
315+
correct use and without having to know the exact precision of floating
316+
point values on a particular machine.}
317+
All other errors raise exceptions.
313318

314319
If the right argument is a dictionary (or any kind of mapping), then
315320
the formats in the string must have a parenthesized key into that
@@ -350,7 +355,7 @@ \subsubsection{Mutable Sequence Types.}
350355
\lineiii{del \var{s}[\var{i}:\var{j}]}
351356
{same as \code{\var{s}[\var{i}:\var{j}] = []}}{}
352357
\lineiii{\var{s}.append(\var{x})}
353-
{same as \code{\var{s}[len(\var{x}):len(\var{x})] = [\var{x}]}}{}
358+
{same as \code{\var{s}[len(\var{s}):len(\var{s})] = [\var{x}]}}{}
354359
\lineiii{\var{s}.count(\var{x})}
355360
{return number of \var{i}'s for which \code{\var{s}[\var{i}] == \var{x}}}{}
356361
\lineiii{\var{s}.index(\var{x})}

0 commit comments

Comments
 (0)