mirror of
https://github.com/django/django.git
synced 2025-08-18 17:50:58 +00:00
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
This commit is contained in:
parent
a3d015fad0
commit
78d557bf02
2 changed files with 12 additions and 1 deletions
|
@ -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']})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue