@@ -429,25 +429,26 @@ are always available. They are listed here in alphabetical order.
429429
430430.. function :: float([x])
431431
432- Convert a string or a number to floating point. If the argument is a string, it
433- must contain a possibly signed decimal or floating point number, possibly
434- embedded in whitespace. The argument may also be [+|-]nan or [+|-]inf.
435- Otherwise, the argument may be a plain integer
436- or a floating point number, and a floating point number with the same value
437- (within Python's floating point precision) is returned. If no argument is
438- given, returns ``0.0 ``.
432+ Convert a string or a number to floating point. If the argument is a string,
433+ it must contain a possibly signed decimal or floating point number, possibly
434+ embedded in whitespace. The argument may also be `` ' [+|-]nan' `` or
435+ `` '[+|-]inf' ``. Otherwise, the argument may be an integer or a floating
436+ point number, and a floating point number with the same value (within
437+ Python's floating point precision) is returned. If no argument is given,
438+ ``0.0 `` is returned .
439439
440440 .. note ::
441441
442442 .. index ::
443443 single: NaN
444444 single: Infinity
445445
446- When passing in a string, values for NaN and Infinity may be returned, depending
447- on the underlying C library. Float accepts the strings nan, inf and -inf for
448- NaN and positive or negative infinity. The case and a leading + are ignored as
449- well as a leading - is ignored for NaN. Float always represents NaN and infinity
450- as nan, inf or -inf.
446+ When passing in a string, values for NaN and Infinity may be returned,
447+ depending on the underlying C library. Float accepts the strings
448+ ``'nan' ``, ``'inf' `` and ``'-inf' `` for NaN and positive or negative
449+ infinity. The case and a leading + are ignored as well as a leading - is
450+ ignored for NaN. Float always represents NaN and infinity as ``nan ``,
451+ ``inf `` or ``-inf ``.
451452
452453 The float type is described in :ref: `typesnumeric `.
453454
@@ -873,15 +874,15 @@ are always available. They are listed here in alphabetical order.
873874.. XXX does accept objects with __index__ too
874875 .. function :: range([start,] stop[, step])
875876
876- This is a versatile function to create lists containing arithmetic progressions.
877- It is most often used in :keyword: `for ` loops. The arguments must be plain
878- integers. If the *step * argument is omitted, it defaults to ``1 ``. If the
879- *start * argument is omitted, it defaults to ``0 ``. The full form returns a list
880- of plain integers ``[start, start + step, start + 2 * step, ...] ``. If * step *
881- is positive, the last element is the largest ``start + i * step `` less than
882- *stop *; if *step * is negative, the last element is the smallest `` start + i *
883- step `` greater than *stop *. *step * must not be zero (or else :exc: ` ValueError `
884- is raised). Example:
877+ This is a versatile function to create iterators yielding arithmetic
878+ progressions. It is most often used in :keyword: `for ` loops. The arguments
879+ must be integers. If the *step * argument is omitted, it defaults to ``1 ``.
880+ If the *start * argument is omitted, it defaults to ``0 ``. The full form
881+ returns an iterator of integers ``[start, start + step, start + 2 * step,
882+ ...] ``. If * step * is positive, the last element is the largest ``start + i *
883+ step `` less than *stop *; if *step * is negative, the last element is the
884+ smallest `` start + i * step `` greater than *stop *. *step * must not be zero
885+ (or else :exc: ` ValueError ` is raised). Example:
885886
886887 >>> list (range (10 ))
887888 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
0 commit comments