[Bug 525366] Re: failing tests for removing items from lists and dicts

2 views
Skip to first unread message

David Glick

unread,
Feb 21, 2010, 11:25:38 AM2/21/10
to pynie-dev-ga...@googlegroups.com

** Patch added: "tests for item deletion"
http://launchpadlibrarian.net/39480637/item_removal_tests.patch

--
failing tests for removing items from lists and dicts
https://bugs.launchpad.net/bugs/525366
You received this bug notification because you are a member of pynie-
dev, which is the registrant for Pynie.

Status in Pynie - Python on Parrot: New

Bug description:
I was also inspired by your talk to try out pynie, and ended up adding a couple tests demonstrating that you can't yet use "del" to remove items from lists or dicts.


David Glick

unread,
Feb 21, 2010, 11:25:38 AM2/21/10
to pynie-dev-ga...@googlegroups.com
Public bug reported:

I was also inspired by your talk to try out pynie, and ended up adding a
couple tests demonstrating that you can't yet use "del" to remove items
from lists or dicts.

** Affects: pynie
Importance: Undecided
Status: New

Allison Randal

unread,
Feb 22, 2010, 3:45:43 PM2/22/10
to pynie-dev-ga...@googlegroups.com
Wonderful, thanks! The two added tests didn't pass on Python 3.1 either
(run the test file directly 'python3 lists.py' and 'python3 dicts.py')
so I modified them. Once they passed on python3, they also passed on
pynie. I've committed the modified test patch (attached). If the
modified tests don't exercise the same edge cases as the original tests,
more tests are welcome. Thanks!

** Attachment added: "item_removal_tests_revised.patch"
http://launchpadlibrarian.net/39559383/item_removal_tests_revised.patch

David Glick

unread,
Feb 22, 2010, 5:41:51 PM2/22/10
to pynie-dev-ga...@googlegroups.com
Aha, sorry for not checking against Python 3.1. However, with a fresh
checkout and build of pynie (since I saw you committed the tests) I'm
still getting failures when running these tests with pynie. Am I
missing some step in re-building pynie? (I did 'svn up; python setup.py
build') Thanks!

Allison Randal

unread,
Feb 22, 2010, 6:07:27 PM2/22/10
to pynie-dev-ga...@googlegroups.com
Okay, I've got the semantics right to expose the failures now, will
commit fixes to make the test pass. Thanks!

Allison Randal

unread,
Feb 24, 2010, 2:02:19 AM2/24/10
to pynie-dev-ga...@googlegroups.com
I committed the fix for deleting keys in revision 113. The new lists
test is now passing. The dict test is failing, but it's because of a bug
in "if...in" (which reports true no matter what you put in the string).
The dict key is actually removed by del now, as shown by the test I
added in revision 114. Will fix the 'in' test next.

David Glick

unread,
Feb 24, 2010, 2:44:29 AM2/24/10
to pynie-dev-ga...@googlegroups.com
Cool, thanks. Not sure if you found the cause of the problem with 'in'
already, but in case it helps, here's an interpreter session where I was
noticing weirdness with it:

davisagli:pynie davidg$ ./pynie
Pynie: a Python compiler for Parrot.
>>> a = {'bar':1}
>>> 'bar' in a
Unable to set lvalue on PAST::Val node
>>> 'bar' not in a
Unable to set lvalue on PAST::Val node
>>> print('bar' in a)
bar

where expected output would be:

>>> davisagli:pynie davidg$ python3.1
Python 3.1.1 (r311:74480, Feb 22 2010, 17:09:30)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {'bar':1}
>>> 'bar' in a
True
>>> 'bar' not in a
False
>>> print('bar' in a)
True

Reply all
Reply to author
Forward
0 new messages