Title: maximum recursion depth in deepcopy regression · Issue #126817 · python/cpython · GitHub
Open Graph Title: maximum recursion depth in deepcopy regression · Issue #126817 · python/cpython
X Title: maximum recursion depth in deepcopy regression · Issue #126817 · python/cpython
Description: Bug report Bug description: The following code works on py313 and below (this is a very cut-down version of some code in Matplotilb (matplotlib.path.Path)) but hit the maximum recursion depth on main. # Add a code block here, if required...
Open Graph Description: Bug report Bug description: The following code works on py313 and below (this is a very cut-down version of some code in Matplotilb (matplotlib.path.Path)) but hit the maximum recursion depth on ma...
X Description: Bug report Bug description: The following code works on py313 and below (this is a very cut-down version of some code in Matplotilb (matplotlib.path.Path)) but hit the maximum recursion depth on ma...
Opengraph URL: https://github.com/python/cpython/issues/126817
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"maximum recursion depth in deepcopy regression","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nThe following code works on py313 and below (this is a very cut-down version of some code in Matplotilb (`matplotlib.path.Path`)) but hit the maximum recursion depth on main. \r\n\r\n```python\r\n# Add a code block here, if required\r\nimport copy\r\n\r\nclass Test:\r\n def __init__(self, a, b):\r\n self.a = a\r\n self.b = a\r\n self._state = True\r\n\r\n def __deepcopy__(self, memo=None):\r\n p = copy.deepcopy(super(), memo)\r\n p._state = False\r\n return p\r\n\r\nt = Test(1, 2)\r\nt2 = copy.deepcopy(t)\r\n\r\n```\r\n\r\nI bisected this to https://github.com/python/cpython/pull/125781/ and suspect the problem is that because it is returning a new object it is escaping the memoization and looping.\r\n\r\nI'm happy to be told we should not be doing this fix it on the Matplotlib side, but I would like to be sure that this was an expected consequence of the change. \r\n\r\nattn @serhiy-storchaka\r\n\r\n\r\n### CPython versions tested on:\r\n\r\n3.14, CPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nLinux","author":{"url":"https://github.com/tacaswell","@type":"Person","name":"tacaswell"},"datePublished":"2024-11-14T03:56:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/126817/cpython/issues/126817"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cdc4ff48-dc72-e457-a25c-e53d6e1a5923 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 965E:1B00D1:9E87AF:D0FC8C:6A518884 |
| html-safe-nonce | 081ddb9897ab70a2d278735137650189006c4110fe681ef5d6ad135e6c37c989 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjVFOjFCMDBEMTo5RTg3QUY6RDBGQzhDOjZBNTE4ODg0IiwidmlzaXRvcl9pZCI6IjE0MzgwODA0Njk4MjQ1Mzg3NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 91c85c1799aca88e73a3f6ed8f6882d1508194aefd4b3dafbb3d92ccf3cf25ce |
| hovercard-subject-tag | issue:2657492212 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/126817/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89f95643bf76a88667a6b0fa9af225ec44a1f3dda1ef7fa1031baa89fc0c1215/python/cpython/issues/126817 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89f95643bf76a88667a6b0fa9af225ec44a1f3dda1ef7fa1031baa89fc0c1215/python/cpython/issues/126817 |
| og:image:alt | Bug report Bug description: The following code works on py313 and below (this is a very cut-down version of some code in Matplotilb (matplotlib.path.Path)) but hit the maximum recursion depth on ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tacaswell |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cb77a7b8b06cd86c243be33fd8e7922d70a9d243 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width