mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666)
This commit is contained in:
parent
e4b88c1e4a
commit
357e9e9da3
3 changed files with 15 additions and 0 deletions
|
|
@ -804,9 +804,17 @@ def test_copy(self):
|
|||
TE = self.MainEnum
|
||||
copied = copy.copy(TE)
|
||||
self.assertEqual(copied, TE)
|
||||
self.assertIs(copied, TE)
|
||||
deep = copy.deepcopy(TE)
|
||||
self.assertEqual(deep, TE)
|
||||
self.assertIs(deep, TE)
|
||||
|
||||
def test_copy_member(self):
|
||||
TE = self.MainEnum
|
||||
copied = copy.copy(TE.first)
|
||||
self.assertIs(copied, TE.first)
|
||||
deep = copy.deepcopy(TE.first)
|
||||
self.assertIs(deep, TE.first)
|
||||
|
||||
class _FlagTests:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue