#21515 closed Uncategorized (fixed)
template.Context Documentation: c.pop() and c.push() return nothing in the example
| Reported by: | Pablo Oubiña | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.6 |
| Severity: | Normal | Keywords: | context, pop, push |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
https://docs.djangoproject.com/en/1.6/ref/templates/api/#django.template.Context.pop shows:
>>> c = Context() >>> c['foo'] = 'first level' >>> c.push() >>> c['foo'] = 'second level' >>> c['foo'] 'second level' >>> c.pop() >>> c['foo'] 'first level'
Is my suggestion more understandable?
>>> c = Context()
>>> c['foo'] = 'first level'
>>> c.push()
{}
>>> c['foo'] = 'second level'
>>> c['foo']
'second level'
>>> c.pop()
{'foo': 'second level'}
>>> c['foo']
'first level'
Note:
See TracTickets
for help on using tickets.
In 077af42139db84d88f293ab5eadc989a9169dce1: