--
Ticket URL: <https://code.djangoproject.com/ticket/28893>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "narrow.patch" added.
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* component: Uncategorized => Core (Other)
* stage: Unreviewed => Accepted
Comment:
`keys()` is generally unneeded. Something like `for name in
tb_frame.f_locals` does an implicit keys; see
21046e77734278cea871dce922220bf29aa5b7b4. I guess you didn't test the
patch as there's at least one mistake in `debug.py` that broke things.
By the way, is there something preventing you from submitting patches on
GitHub? If it's only the knowledge of how to to do, we have
[https://docs.djangoproject.com/en/dev/intro/contributing/#committing-the-
changes-in-the-patch a tutorial].
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:1>
* cc: Sergey Fedoseev (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:2>
Comment (by Дилян Палаузов):
Yes, it is better not to apply the last snippet in debug.py.
I know that iterating over a {{{dict:}}} and {{{dict.keys():}}} is
effectively the same, but while the later returns (an iterator of) a view,
I don't know what the former returns and therefore whether both forms are
really equivalent.
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:3>
Comment (by Sergey Fedoseev):
Replying to [comment:3 Дилян Палаузов]:
> I know that iterating over a {{{dict:}}} and {{{dict.keys():}}} is
effectively the same, but while the later returns (an iterator of) a view,
I don't know what the former returns and therefore whether both forms are
really equivalent.
{{{
In [2]: iter({})
Out[2]: <dict_keyiterator at 0x7fd09e6d3598>
In [3]: iter({}.keys())
Out[3]: <dict_keyiterator at 0x7fd09e6d3728>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:4>
* needs_better_patch: 1 => 0
Comment:
[https://github.com/django/django/pull/9437 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"a862af383969ade774f6b0fa1d331bc87b188b89" a862af38]:
{{{
#!CommitTicketReference repository=""
revision="a862af383969ade774f6b0fa1d331bc87b188b89"
Fixed #28893 -- Removed unnecessary dict.items() calls.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28893#comment:6>