Opened 17 years ago

Closed 17 years ago

#6050 closed (fixed)

SortedDict can have multiple copies of same key/value pair when iterated over

Reported by: stephen.judkins@… Owned by: nobody
Component: Tools Version: dev
Severity: Keywords: SortedDict
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Behavior is like this:

>>> from django.utils.datastructures import SortedDict
>>> SortedDict([('foo', 'bar'), ('foo', 'baz')])
{'foo': 'baz', 'foo': 'baz'}

It should be like this:

>>> SortedDict([('foo', 'bar'), ('foo', 'baz')])
{'foo': 'baz'}

Attachments (2)

6050.patch (610 bytes ) - added by Collin Grady <cgrady@…> 17 years ago.
6050.diff (3.2 KB ) - added by Chris Beaven 17 years ago.
With a new test module for SortedDict - hardly complete but shows basic usage and expected behaviour of this bug

Download all attachments as: .zip

Change History (5)

by Collin Grady <cgrady@…>, 17 years ago

Attachment: 6050.patch added

by Chris Beaven, 17 years ago

Attachment: 6050.diff added

With a new test module for SortedDict - hardly complete but shows basic usage and expected behaviour of this bug

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Chris Beaven, 17 years ago

Has patch: set

comment:3 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [6751]) Fixed #6050 -- Handled edge-case of duplicate keys being passed when
initialising SortedDict. Patch from Collin Grady and SmileyChris.

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