Opened 18 years ago
Closed 18 years ago
#6050 closed (fixed)
SortedDict can have multiple copies of same key/value pair when iterated over
| Reported by: | 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)
Change History (5)
by , 18 years ago
| Attachment: | 6050.patch added |
|---|
by , 18 years ago
comment:1 by , 18 years ago
| Triage Stage: | Unreviewed → Ready for checkin |
|---|
comment:2 by , 18 years ago
| Has patch: | set |
|---|
comment:3 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
(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.
With a new test module for SortedDict - hardly complete but shows basic usage and expected behaviour of this bug