Traceback (most recent call last):
File "Lib/test/bootstrap/dicts.py", line 25, in <module>
if a.keys()[0] == 1: print('success: integer as index')
TypeError: 'dict_keys' object does not support indexing
So I tweaked that test to:
a = {1: 2}
b = list(a.keys())
if b[0] == 1: print('success: integer as index')
Thanks, these are great! I've committed the test with the fixes to make it pass.
One of the tests didn't work in Python 3 (I found an explanation in http:// blog.labix. org/2008/ 06/27/watch- out-for- listdictkeys- in-python- 3):
Traceback (most recent call last): bootstrap/ dicts.py" , line 25, in <module>
File "Lib/test/
if a.keys()[0] == 1: print('success: integer as index')
TypeError: 'dict_keys' object does not support indexing
So I tweaked that test to:
a = {1: 2}
b = list(a.keys())
if b[0] == 1: print('success: integer as index')
Thanks for the contribution!