[patch] Change the way BaseContext maintains the dicts
|Reported by:||suzaku||Owned by:||suzaku|
|Cc:||Alex, Fredde, satorulogic@…||Triage Stage:||Unreviewed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In django.template.context, BaseContext is the base class of several context classes.
By maintaining a list of dict, it supports a LIFO way of resolving template variables with contexts.
In the __getitem__ method, it searches for a dict reversely using reversed, I think I can make it a little faster by just iterating the dict list, and maintain the reversed list in push.
Change History (12)
Changed 6 years ago by suzaku
comment:1 follow-up: ↓ 4 Changed 6 years ago by Alex
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset