mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
* 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:
parent
d456849f19
commit
a690a9967e
21 changed files with 2338 additions and 40 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue