diff options
| author | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-14 04:17:02 +0000 |
|---|---|---|
| committer | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-14 04:17:02 +0000 |
| commit | 78d557bf024db83f41c9650c58700efd24172821 (patch) | |
| tree | 01f058a34e724fb755d16a35e94f5022bbd950f7 /tests/regressiontests/datastructures | |
| parent | a3d015fad09e0376484b0e7c4b00f07243ee3af6 (diff) | |
Fixed #5744 -- Allowed SortedDict contructor to be passed a list of tuples to match the interface of dict, thanks Thomas Güttler.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index 3920e1ca40..b58ee79693 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -55,6 +55,14 @@ True >>> print repr(d) {'one': 'not one', 'two': 'two', 'three': 'three'} +Init from sequence of tuples +>>> d = SortedDict(( +... (1, "one"), +... (0, "zero"), +... (2, "two"))) +>>> print repr(d) +{1: 'one', 0: 'zero', 2: 'two'} + ### DotExpandedDict ############################################################ >>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']}) |
