Opened 3 years ago

Closed 3 years ago

Last modified 22 months 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 Changed 3 years ago by Tim Graham

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 Changed 3 years ago by Adam Zapletal

Owner: changed from nobody to Adam Zapletal
Status: newassigned

comment:3 Changed 3 years ago by Adam Zapletal

Has patch: set

comment:4 Changed 3 years ago by priidukull

Owner: changed from Adam Zapletal to priidukull

comment:5 Changed 3 years ago by Adam Zapletal

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 Changed 3 years ago by Tim Graham <timograham@…>

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 Changed 22 months ago by Tim Graham <timograham@…>

In 973f3937:

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

comment:8 Changed 22 months ago by Tim Graham <timograham@…>

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