Opened 9 years ago

Closed 9 years ago

#2620 closed defect (fixed)

Two-argument form of MergeDict.get() fails

Reported by: shields@… Owned by: adrian
Component: Metasystem Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

django.utils.datastructures.MergeDict does not behave completely like a Python intrinsic dict, because the get() method cannot be called without a default argument.

TypeError: get() takes exactly 3 arguments (2 given)

Attached is a patch which fixes this, and adds a unit test for MergeDict.

Attachments (2)

2620.patch (975 bytes) - added by shields@… 9 years ago.
mergedict_get.patch (443 bytes) - added by SmileyChris 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by shields@…

comment:1 Changed 9 years ago by adrian

  • Summary changed from [patch] Two-argument form of MergeDict.get() fails to Two-argument form of MergeDict.get() fails

The patch doesn't appear to fix this entirely, and it doesn't include a unit test as you suggest. Are you sure you uploaded the right patch?

comment:2 Changed 9 years ago by SmileyChris

  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Yea this annoys me too.

comment:3 Changed 9 years ago by SmileyChris

It doesn't really need a unit test: the fix is dead easy and backwards compatible.

Changed 9 years ago by SmileyChris

comment:4 Changed 9 years ago by SmileyChris

  • Has patch set
  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 9 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [4576]) Fixed #2620: made MergeDict.get() correctly work with the two-argument form of get(). Thanks for the patch, SmileyChris.

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