#23838: LazyObject is missing __iter__
-------------------------------+--------------------
Reporter: rednaw | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
The `LazyObject` class in `utils.functional`
(https://github.com/django/django/blob/master/django/utils/functional.py#L235)
is missing the `__iter__` magic method.
Other dict related magic methods like `__getitem__`, `__setitem__` and
`__delitem__` are supported but not `__iter__`. I can't think of a reason
it isn't there and haven't been able to find discussions about it. The
`__getitem__`, `__setitem__` and `__delitem__` were added in this ticket:
https://code.djangoproject.com/ticket/18447
I think they just forgot `__iter__`. I'm proposing to add this. If this is
done, then tickets like these:
https://code.djangoproject.com/ticket/23783
Can be resolved with `SimpleLazyObject` (which implements `LazyObject`).
--
Ticket URL: <https://code.djangoproject.com/ticket/23838>
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/049.9c58adb466307cfdaf9da970761bf588%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.