.. seealso::
* IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic
- Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`_.
+ Specification <http://speleotrove.com/decimal/>`_.
* IEEE standard 854-1987, `Unofficial IEEE 854 Text
<http://754r.ucbtest.org/standards/854.pdf>`_.
.. method:: is_normal()
- Return :const:`True` if the argument is a *normal* finite number. Return
- :const:`False` if the argument is zero, subnormal, infinite or a NaN.
+ Return :const:`True` if the argument is a *normal* finite non-zero
+ number with an adjusted exponent greater than or equal to *Emin*.
+ Return :const:`False` if the argument is zero, subnormal, infinite or a
+ NaN. Note, the term *normal* is used here in a different sense with
+ the :meth:`normalize` method which is used to create canonical values.
.. versionadded:: 2.6
.. method:: is_subnormal()
Return :const:`True` if the argument is subnormal, and :const:`False`
- otherwise.
+ otherwise. A number is subnormal is if it is nonzero, finite, and has an
+ adjusted exponent less than *Emin*.
.. versionadded:: 2.6
its :meth:`next` method; if the value returned is equal to *sentinel*,
:exc:`StopIteration` will be raised, otherwise the value will be returned.
+ One useful application of the second form of :func:`iter` is to read lines of
+ a file until a certain line is reached. The following example reads a file
+ until ``"STOP"`` is reached: ::
+
+ with open("mydata.txt") as fp:
+ for line in iter(fp.readline, "STOP"):
+ process_line(line)
+
.. versionadded:: 2.2
.. function:: unpack_from(fmt, buffer[,offset=0])
- Unpack the *buffer* according to tthe given format. The result is a tuple even
+ Unpack the *buffer* according to the given format. The result is a tuple even
if it contains exactly one item. The *buffer* must contain at least the amount
of data required by the format (``len(buffer[offset:])`` must be at least
``calcsize(fmt)``).
If the name is used as the target of a function or class statement, this
will be true.
+ For example::
+
+ >>> table = symtable.symtable("def some_func(): pass", "string", "exec")
+ >>> table.lookup("some_func").is_namespace()
+ True
+
Note that a single name can be bound to multiple objects. If the result
is ``True``, the name may also be bound to other objects, like an int or
list, that does not introduce a new namespace.
Arguments to rich comparison methods are never coerced.
+ To automatically generate ordering operations from a single root operation,
+ see the `Total Ordering recipe in the ASPN cookbook
+ <http://code.activestate.com/recipes/576529/>`_\.
.. method:: object.__cmp__(self, other)