Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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'

Change History (3)

comment:1 by Baptiste Mispelon <bmispelon@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 077af42139db84d88f293ab5eadc989a9169dce1:

Fixed #21515 -- Corrected example of template.Context in documentation.

Thanks to trac user oubiga for the report.

comment:2 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In 02f9e90fdfe795992d674094fe25919bb885bf0d:

[1.6.x] Fixed #21515 -- Corrected example of template.Context in documentation.

Thanks to trac user oubiga for the report.

Backport of 077af42139db84d88f293ab5eadc989a9169dce1 from master.

comment:3 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In 0e98050847644f66c6aad38e359d560594a7a4cc:

[1.5.x] Fixed #21515 -- Corrected example of template.Context in documentation.

Thanks to trac user oubiga for the report.

Backport of 077af42139db84d88f293ab5eadc989a9169dce1 from master.

Note: See TracTickets for help on using tickets.
Back to Top