mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-40521: Empty frozenset is no longer a singleton (GH-21085)
* Revert "bpo-40521: Make the empty frozenset per interpreter (GH-21068)"
This reverts commit 261cfedf76
.
* bpo-40521: Empty frozensets are no longer singletons
* Complete the removal of the frozenset singleton
This commit is contained in:
parent
522691c46e
commit
f9bd05e83e
8 changed files with 8 additions and 54 deletions
|
@ -661,15 +661,6 @@ class TestFrozenSet(TestJointOps, unittest.TestCase):
|
|||
s.__init__(self.otherword)
|
||||
self.assertEqual(s, set(self.word))
|
||||
|
||||
def test_singleton_empty_frozenset(self):
|
||||
f = frozenset()
|
||||
efs = [frozenset(), frozenset([]), frozenset(()), frozenset(''),
|
||||
frozenset(), frozenset([]), frozenset(()), frozenset(''),
|
||||
frozenset(range(0)), frozenset(frozenset()),
|
||||
frozenset(f), f]
|
||||
# All of the empty frozensets should have just one id()
|
||||
self.assertEqual(len(set(map(id, efs))), 1)
|
||||
|
||||
def test_constructor_identity(self):
|
||||
s = self.thetype(range(3))
|
||||
t = self.thetype(s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue