#24600 closed Bug (fixed)
Accessing deleted keys in Context objects do not return empty strings (raises KeyError)
Reported by: | Ed Patrick Tan | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | pat.keeps.looking.up@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In the template documentation on playing with context objects, it is showed that deleting the key foo
then accessing it again returns an empty string.
What actually happens: a KeyError
is raised:
>>> from django.template import Context >>> c = Context({'foo': 'bar'}) >>> c['foo'] 'bar' >>> del c['foo'] >>> c['foo'] Traceback (most recent call last): ... KeyError: 'foo'
Change History (4)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 3acefce: