Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#24621 closed Bug (fixed)

request.session.pop's second param is not documented

Reported by: Gábor Farkas Owned by: Adam Zapletal
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

python dictionaries support the pop method's second parameter, for example {}.pop('key','default') .

the django session seems to support this second parameter too, but the documentation does not mention it, so i'm not sure if i can use it or not.

Change History (8)

comment:1 by Tim Graham, 9 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

I think it's just an oversite in the docs as the behavior is tested.

comment:2 by Adam Zapletal, 9 years ago

Owner: changed from nobody to Adam Zapletal
Status: newassigned

comment:3 by Adam Zapletal, 9 years ago

Has patch: set

comment:4 by priidukull, 9 years ago

Owner: changed from Adam Zapletal to priidukull

comment:5 by Adam Zapletal, 9 years ago

Owner: changed from priidukull to Adam Zapletal

I've got this one, priidukull. I'll remove myself as owner if I'm not able to close it. Thanks!

Discussion is happening here: https://github.com/django/django/pull/4480

comment:6 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 872eb26:

Fixed #24621 -- Fixed and documented SessionBase.pop's second argument

Changed SessionBase.pop's second argument to explicitly be default=None
rather than *args since _session is always a dict. Thanks gabor for the
report and Tim Graham for the review.

comment:7 by Tim Graham <timograham@…>, 8 years ago

In 973f3937:

Refs #24621 -- Added a test for SessionBase.pop()'s 'default' argument.

comment:8 by Tim Graham <timograham@…>, 8 years ago

In ebb55a24:

[1.9.x] Refs #24621 -- Added a test for SessionBase.pop()'s 'default' argument.

Backport of 973f393761253f5fbf031f435d103545f1927041 from master

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