Commits

georg.brandl  committed 1257c78

Document set constructors in stdtypes.

  • Participants
  • Parent commits 45447ff

Comments (0)

Files changed (4)

File Doc-26/library/functions.rst

 
    The complex type is described in :ref:`typesnumeric`.
 
+
 .. function:: delattr(object, name)
 
    This is a relative of :func:`setattr`.  The arguments are an object and a
 .. function:: dict([arg])
    :noindex:
 
-   Create a new data dictionary.  The dictionary type is described in
-   :ref:`typesmapping`. For other containers see the built in
-   :class:`list`, :class:`set`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   Create a new data dictionary, optionally with items taken from *arg*.
+   The dictionary type is described in :ref:`typesmapping`.
+
+   For other containers see the built in :class:`list`, :class:`set`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
 
 .. function:: dir([object])
    The float type is described in :ref:`typesnumeric`.
 
 .. function:: frozenset([iterable])
+   :noindex:
 
-   Return a frozenset object whose elements are taken from *iterable*. Frozensets
-   are sets that have no update methods but can be hashed and used as members of
-   other sets or as dictionary keys.  The elements of a frozenset must be immutable
-   themselves.  To represent sets of sets, the inner sets should also be
-   :class:`frozenset` objects.  If *iterable* is not specified, returns a new empty
-   set, ``frozenset([])``.
+   Return a frozenset object, optionally with elements taken from *iterable*.
+   The frozenset type is described in :ref:`types-set`.
 
-   The frozenset type is described in :ref:`types-set`. For other containers see the built in
-   :class:`dict`, :class:`list`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   For other containers see the built in :class:`dict`, :class:`list`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
    .. versionadded:: 2.4
 
 
 
 .. function:: set([iterable])
+   :noindex:
 
-   Return a set whose elements are taken from *iterable*.  The elements must be
-   immutable.  To represent sets of sets, the inner sets should be
-   :class:`frozenset` objects.  If *iterable* is not specified, returns a new empty
-   set, ``set([])``.
+   Return a new set, optionally with elements are taken from *iterable*.
+   The set type is described in :ref:`types-set`.
 
-   The set type is described in :ref:`types-set`. For other containers see the built in
-   :class:`dict`, :class:`list`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   For other containers see the built in :class:`dict`, :class:`list`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
    .. versionadded:: 2.4
 

File Doc-26/library/stdtypes.rst

 like :meth:`add` and :meth:`remove`.  Since it is mutable, it has no hash value
 and cannot be used as either a dictionary key or as an element of another set.
 The :class:`frozenset` type is immutable and hashable --- its contents cannot be
-altered after is created; however, it can be used as a dictionary key or as an
-element of another set.
+altered after it is created; it can therefore be used as a dictionary key or as
+an element of another set.
+
+The constructors for both classes work the same:
+
+.. class:: set([iterable])
+           frozenset([iterable])
+
+   Return a new set or frozenset object whose elements are taken from
+   *iterable*.  The elements of a set must be hashable.  To represent sets of
+   sets, the inner sets must be :class:`frozenset` objects.  If *iterable* is
+   not specified, a new empty set is returned.
 
 Instances of :class:`set` and :class:`frozenset` provide the following
 operations:

File Doc-3k/library/functions.rst

 
    The complex type is described in :ref:`typesnumeric`.
 
+
 .. function:: delattr(object, name)
 
    This is a relative of :func:`setattr`.  The arguments are an object and a
 .. function:: dict([arg])
    :noindex:
 
-   Create a new data dictionary.  The dictionary type is described in
-   :ref:`typesmapping`. For other containers see the built in
-   :class:`list`, :class:`set`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   Create a new data dictionary, optionally with items taken from *arg*.
+   The dictionary type is described in :ref:`typesmapping`.
+
+   For other containers see the built in :class:`list`, :class:`set`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
 
 .. function:: dir([object])
    The float type is described in :ref:`typesnumeric`.
 
 .. function:: frozenset([iterable])
+   :noindex:
 
-   Return a frozenset object whose elements are taken from *iterable*. Frozensets
-   are sets that have no update methods but can be hashed and used as members of
-   other sets or as dictionary keys.  The elements of a frozenset must be immutable
-   themselves.  To represent sets of sets, the inner sets should also be
-   :class:`frozenset` objects.  If *iterable* is not specified, returns a new empty
-   set, ``frozenset([])``.
+   Return a frozenset object, optionally with elements taken from *iterable*.
+   The frozenset type is described in :ref:`types-set`.
 
-   The frozenset type is described in :ref:`types-set`. For other containers see the built in
-   :class:`dict`, :class:`list`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   For other containers see the built in :class:`dict`, :class:`list`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
    .. versionadded:: 2.4
 
 
 
 .. function:: set([iterable])
+   :noindex:
 
-   Return a set whose elements are taken from *iterable*.  The elements must be
-   immutable.  To represent sets of sets, the inner sets should be
-   :class:`frozenset` objects.  If *iterable* is not specified, returns a new empty
-   set, ``set([])``.
+   Return a new set, optionally with elements are taken from *iterable*.
+   The set type is described in :ref:`types-set`.
 
-   The set type is described in :ref:`types-set`. For other containers see the built in
-   :class:`dict`, :class:`list`, and :class:`tuple` classes, and the
-   :mod:`collections` module.
+   For other containers see the built in :class:`dict`, :class:`list`, and
+   :class:`tuple` classes, and the :mod:`collections` module.
 
    .. versionadded:: 2.4
 

File Doc-3k/library/stdtypes.rst

 like :meth:`add` and :meth:`remove`.  Since it is mutable, it has no hash value
 and cannot be used as either a dictionary key or as an element of another set.
 The :class:`frozenset` type is immutable and hashable --- its contents cannot be
-altered after is created; however, it can be used as a dictionary key or as an
-element of another set.
+altered after it is created; it can therefore be used as a dictionary key or as
+an element of another set.
+
+The constructors for both classes work the same:
+
+.. class:: set([iterable])
+           frozenset([iterable])
+
+   Return a new set or frozenset object whose elements are taken from
+   *iterable*.  The elements of a set must be hashable.  To represent sets of
+   sets, the inner sets must be :class:`frozenset` objects.  If *iterable* is
+   not specified, a new empty set is returned.
 
 Instances of :class:`set` and :class:`frozenset` provide the following
 operations: