* Migrate set() and frozenset() from the sandbox.

* Install the unittests, docs, newsitem, include file, and makefile update.
* Exercise the new functions whereever sets.py was being used.

Includes the docs for libfuncs.tex.  Separate docs for the types are
forthcoming.
This commit is contained in:
Raymond Hettinger 2003-11-16 16:17:49 +00:00
parent d456849f19
commit a690a9967e
21 changed files with 2338 additions and 40 deletions

View file

@ -477,6 +477,17 @@ class C:
and is known to vary.}
\end{funcdesc}
\begin{funcdesc}{frozenset}{\optional{iterable}}
Return a frozenset object whose elements are taken from \var{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
\var{iterable} is not specified, returns a new empty set,
\code{frozenset([])}.
\versionadded{2.4}
\end{funcdesc}
\begin{funcdesc}{getattr}{object, name\optional{, default}}
Return the value of the named attributed of \var{object}. \var{name}
must be a string. If the string is the name of one of the object's
@ -897,6 +908,14 @@ class C(object):
\code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}).
\end{funcdesc}
\begin{funcdesc}{set}{\optional{iterable}}
Return a set whose elements are taken from \var{iterable}. The elements
must be immutable. To represent sets of sets, the inner sets should
be \class{frozenset} objects. If \var{iterable} is not specified,
returns a new empty set, \code{set([])}.
\versionadded{2.4}
\end{funcdesc}
\begin{funcdesc}{setattr}{object, name, value}
This is the counterpart of \function{getattr()}. The arguments are an
object, a string and an arbitrary value. The string may name an