#26122: copy.copy() broken with SimpleLazyObject in 1.8.5
---------------------------+--------------------------------------
Reporter: knyghty | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------
Comment (by benjaminjkraft):
Oh, yeah, I can see now how the dummy `__getstate__` might break this,
because it seems like if there's no `__copy__`, `copy` will use
`__getstate__` but not `__reduce__` -- sorry I didn't realize before.
(This stuff is not very well documented so I'll need to look more closely
to be sure that that's the issue but it definitely seems plausible.)
I'm not entirely sure, but the simplest way to solve this is probably just
writing a `__copy__` method for `LazyObject`, either by just proxying the
wrapped object's `__copy__` or by doing something similar to the
`__deepcopy__` implementation. I'm not immediately sure which one of
those is more correct.
--
Ticket URL: <https://code.djangoproject.com/ticket/26122#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.7d1c93d8a85e49e1b61d26ccab3f4d36%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.