html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/7111#issuecomment-1264322604,https://api.github.com/repos/pydata/xarray/issues/7111,1264322604,IC_kwDOAMm_X85LXAgs,32801740,2022-10-01T10:40:48Z,2022-10-01T10:40:48Z,CONTRIBUTOR,"To avoid code duplication you may consider moving all logic from the `copy` methods to new `_copy` methods and extending that with an optional `memo` argument and have the `copy`, `__copy__` and `__deepcopy__` methods as thin wrappers around it.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1392878100 https://github.com/pydata/xarray/issues/7111#issuecomment-1264014472,https://api.github.com/repos/pydata/xarray/issues/7111,1264014472,IC_kwDOAMm_X85LV1SI,32801740,2022-09-30T20:52:28Z,2022-09-30T20:54:25Z,CONTRIBUTOR,"> Is there some feature that python uses to check whether a data structure is recursive when it's copying, which we're not taking advantage of? I can look more later. yes, `def __deepcopy__(self, memo=None)` has the `memo` argument exactly for the purpose of dealing with recursion, see https://docs.python.org/3/library/copy.html. Currently, xarray's `__deepcopy__` methods do not pass on the memo argument when deepcopying its components.","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1392878100