#24600: Accessing deleted keys in Context objects do not return empty strings
(raises KeyError)
-------------------------------+--------------------
     Reporter:  pattypatpat    |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Documentation  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  1              |      UI/UX:  0
-------------------------------+--------------------
 In the [https://docs.djangoproject.com/en/dev/ref/templates/api/#playing-
 with-context-objects 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'
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24600>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.61f6777456a28237798a831444d75c2c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to