additional (failing) tests for dict
Bug #525015 reported by
R. David Murray
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pynie |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Played with pynie after the pycon talk (nice talk), and noticed that the (very new!) dict support has a few issues :). Here are a couple of tests for things I noticed.
To post a comment you must log in.
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!