mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Changes 54857 and 54840 broke code and were reverted in Py2.5 just before
it was released, but that reversion never made it to the Py2.6 head.
This commit is contained in:
parent
8608d91e07
commit
3dbd4c536d
3 changed files with 8 additions and 16 deletions
|
@ -200,14 +200,6 @@ class DictTest(unittest.TestCase):
|
|||
|
||||
self.assertRaises(ValueError, {}.update, [(1, 2, 3)])
|
||||
|
||||
# SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
|
||||
class KeyUpperDict(dict):
|
||||
def __getitem__(self, key):
|
||||
return key.upper()
|
||||
d.clear()
|
||||
d.update(KeyUpperDict.fromkeys('abc'))
|
||||
self.assertEqual(d, {'a':'A', 'b':'B', 'c':'C'})
|
||||
|
||||
def test_fromkeys(self):
|
||||
self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
|
||||
d = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue