| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -432,6 +432,23 @@ def test_deepcopy_frozendict(self): | |
| self.assertIsNot(x, y) | ||
| self.assertIsNot(x["foo"], y["foo"]) | ||
|
|
||
| # recursive frozendict | ||
| x = frozendict(foo=[]) | ||
| x['foo'].append(x) | ||
| y = copy.deepcopy(x) | ||
| self.assertEqual(y.keys(), x.keys()) | ||
| self.assertIsNot(x, y) | ||
| self.assertIsNot(x["foo"], y["foo"]) | ||
|
Comment thread
vstinner marked this conversation as resolved.
|
||
| self.assertIs(y['foo'][0], y) | ||
|
|
||
| x = frozendict(foo=[]) | ||
| x['foo'].append(x) | ||
| x = x['foo'] | ||
| y = copy.deepcopy(x) | ||
| self.assertIsNot(x, y) | ||
| self.assertIsNot(x[0], y[0]) | ||
| self.assertIs(y[0]['foo'], y) | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAdd also other assertions similar to the above ones: self.assertEqual(y, x)
self.assertIsNot(x, y)
self.assertIsNot(x[0], y[0])
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityself.assertEqual(y, x) fails with RecursionError. I added the two other tests.
Sorry, something went wrong.
All reactions
|
||
|
|
||
| @support.skip_emscripten_stack_overflow() | ||
| @support.skip_wasi_stack_overflow() | ||
| def test_deepcopy_reflexive_dict(self): | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.