additional (failing) tests for dict

Bug #525015 reported by R. David Murray
6
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.

Revision history for this message
R. David Murray (rdmurray) wrote :
Revision history for this message
Allison Randal (allison) wrote :

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):
  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 for the contribution!

Changed in pynie:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.