Opened 18 years ago
Closed 18 years ago
#2779 closed enhancement (fixed)
datastructures.MergeDict needs a copy() method
Reported by: | limodou | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
django.utils.datastructures.MergeDict
does not have a copy()
method.
request.REQUEST
is an instance of MergeDict
, so it's not possible to do request.REQUEST.copy()
.
Attachments (1)
Change History (7)
comment:1 by , 18 years ago
Description: | modified (diff) |
---|---|
Summary: | request.REQUEST doesn't support copy() method → datastructures.MergeDict needs a copy() method |
comment:2 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 18 years ago
Has patch: | set |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | → SVN |
Added copy and copy methods to MergeDict. Implements basic shallow copy. I didn't implement deepcopy, as I don't fully understand the role of memo in this documentation: http://www.python.org/doc/1.5.1p1/lib/module-copy.html
Also, it may be useful to change MergeDict to inherit from dict, rather than object. Most of the custom dicts in this module inherit from dict. I didn't know if there was a reason that MergeDict was different. If it's useful to convert MergeDict, I can do that.
I included some doctests in the file. This is my first patch to the project. Hurray for me!
comment:4 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thanks Chris :) I've re-opened this so one of the core devs. can see it.
comment:5 by , 18 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Changed summary and description.