#3529: Context.update doesn't do what it says it does
---------------------------+------------------------------------------------
Reporter: SmileyChris | Owner: adrian
Status: new | Component: Template system
Version: SVN | Resolution:
Keywords: | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------+------------------------------------------------
Comment (by SmileyChris):
Regarding reversing the list in `Context.dicts`, although it would make
popping and pushing slightly faster, it would slow down getting a
variable's value '''a lot''' (based on some `timeit` tests that I just
did). It has probably been done the way it is on purpose because of this.
And on to the main issue, reading the full docstring, `Context.update`
probably ''does'' do what is says it does, but I'm still not convinced it
is doing what it ''should''. As a compromise, I wrote a patch to keep the
current behaviour default and introduce a new argument for `update` so
that you can turn off the pushing behaviour and just update the most
recent context dictionary instead.
--
Ticket URL: <http://code.djangoproject.com/ticket/3529#comment:3>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---