#26520: SessionBase.pop() no longer raises a KeyError
----------------------------------+------------------------------------
Reporter: tuky | Owner: nobody
Type: Bug | Status: new
Component: contrib.sessions | Version: 1.9
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by niconoe):
I am currently trying timgraham's suggested implementation, and it seems
to work well for all those cases:
{{{#!python
(Pdb) session.pop('machin')
*** KeyError: 'machin'
(Pdb) session.pop('machin', 'truc')
'truc'
(Pdb) session.pop('machin', default='truc')
'truc'
}}}
Should I make a pull request with this?
--
Ticket URL: <https://code.djangoproject.com/ticket/26520#comment:8>
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.eafcf10263a978ae8dc5fbb0f83c77a0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.