mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #26146: marshal.loads() now uses the empty frozenset singleton
This commit is contained in:
parent
5ebe2c89fe
commit
1aa78938b0
2 changed files with 50 additions and 32 deletions
|
@ -135,6 +135,13 @@ class ContainerTestCase(unittest.TestCase, HelperMixin):
|
|||
for constructor in (set, frozenset):
|
||||
self.helper(constructor(self.d.keys()))
|
||||
|
||||
@support.cpython_only
|
||||
def test_empty_frozenset_singleton(self):
|
||||
# marshal.loads() must reuse the empty frozenset singleton
|
||||
obj = frozenset()
|
||||
obj2 = marshal.loads(marshal.dumps(obj))
|
||||
self.assertIs(obj2, obj)
|
||||
|
||||
|
||||
class BufferTestCase(unittest.TestCase, HelperMixin):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue