Message333053
> (Just curious, what does d['a'] return?)
I was curious too and some results
$ python
Python 3.7.1rc2 (v3.7.1rc2:6c06ef7dc3, Oct 13 2018, 05:10:29)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import multidict
>>> d = multidict.CIMultiDict([('a', 1), ('a', 2)])
>>> d['a']
1
>>> d.keys()
_KeysView('a', 'a')
>>> d.values()
_ValuesView(1, 2)
>>> d.items()
_ItemsView('a': 1, 'a': 2)
>>> dict(d)
{'a': 1}
In the original issue where PEP 448 was implemented there were some discussions around duplicates in kwargs. msg234413 for Guido's call on duplicates and the messages below discuss some more scenarios about overriding/rejecting duplicates. PEP 448 also has a note on duplicates in https://www.python.org/dev/peps/pep-0448/#specification |
|
Date |
User |
Action |
Args |
2019-01-05 12:15:28 | xtreak | set | recipients:
+ xtreak, terry.reedy, serhiy.storchaka, iceboy, ammar2, remi.lapeyre |
2019-01-05 12:15:27 | xtreak | set | messageid: <1546690527.51.0.950169776266.issue35634@roundup.psfhosted.org> |
2019-01-05 12:15:27 | xtreak | link | issue35634 messages |
2019-01-05 12:15:27 | xtreak | create | |
|