Opened 11 years ago
Closed 11 years ago
#24454 closed Bug (fixed)
SimpleLazyObject __repr__ does not work for collections.namedtuple
| Reported by: | Emil Temirov | Owned by: | Tino de Bruijn |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Normal | Keywords: | SimpleLazyObject, namedtuple, __repr__ |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
Patch:
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -349,7 +349,7 @@ class SimpleLazyObject(LazyObject):
repr_attr = self._setupfunc
else:
repr_attr = self._wrapped
- return '<SimpleLazyObject: %r>' % repr_attr
+ return '<SimpleLazyObject: %r>' % (repr_attr, )
# Need to pretend to be the wrapped class, for the sake of objects that
# care about this (especially in equality tests)
Change History (3)
comment:1 by , 11 years ago
| Easy pickings: | set |
|---|---|
| Needs tests: | set |
| Triage Stage: | Unreviewed → Accepted |
| UI/UX: | unset |
| Version: | 1.6 → master |
comment:2 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 11 years ago
| Has patch: | unset |
|---|---|
| Needs tests: | unset |
| Resolution: | → fixed |
| Status: | assigned → closed |
Already fixed in 61917aa08b4ab2bc35f3ffe87b7693bd8b58e205, which is part of 1.7 already.
Note:
See TracTickets
for help on using tickets.
A test would be nice.