#26520: Undo #24621 to make session.pop raise a KeyError again
----------------------------------+--------------------------------------
Reporter: tuky | Owner: nobody
Type: Bug | Status: new
Component: contrib.sessions | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------+--------------------------------------
Comment (by niconoe):
`dict.pop` raise KeyError if the key is not found AND there's no default
provided as second argument... Won't implementing the same in
`session.pop` reconcile this ticket and
https://code.djangoproject.com/ticket/24621 ?
Example:
{{{
>>> {}.pop('machin')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'machin'
>>> {}.pop('machin', 'truc')
'truc'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26520#comment:5>
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/062.20df4e5fe444d61d26b7a1fb22086933%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.