* 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

@ -1,5 +1,4 @@
import unittest
from sets import Set
from test import test_support
@ -105,8 +104,8 @@ class EnumerateTestCase(unittest.TestCase):
def test_tuple_reuse(self):
# Tests an implementation detail where tuple is reused
# whenever nothing else holds a reference to it
self.assertEqual(len(Set(map(id, list(enumerate(self.seq))))), len(self.seq))
self.assertEqual(len(Set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))
self.assertEqual(len(set(map(id, list(enumerate(self.seq))))), len(self.seq))
self.assertEqual(len(set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))
class MyEnum(enumerate):
pass