Issue 3783 in sympy: Prufer.edges test depends on order of set

2 views
Skip to first unread message

sy...@googlecode.com

unread,
Apr 27, 2013, 4:45:16 PM4/27/13
to sympy-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3783 by hacm...@gmail.com: Prufer.edges test depends on order of
set
http://code.google.com/p/sympy/issues/detail?id=3783

the method Prufer.edges iterates through a set
(sympy/combinatorics/prufer.py line 271), appending elements to a list
(line 277). The test for this method (test_prufer.py lines 21-22) then
check the resulting list against a hard-coded result directly. The order of
set iteration is not deterministic, even for small sets, and is failing in
PyPy 1.8 (32-bit).

The test should sort the resulting list and comapre it to a sorted
hard-coded list rather than just relying on the order of set iteration.

Also, it iterates through the set in an "unpythonic" fashion.

while e:
ei = e.pop()
....

could be replaced by
for ei in e:
....

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sy...@googlecode.com

unread,
Apr 27, 2013, 4:48:07 PM4/27/13
to sympy-...@googlegroups.com
Updates:
Status: Valid

Comment #1 on issue 3783 by asme...@gmail.com: Prufer.edges test depends
It's curious that this doesn't fail with hash randomization. I guess none
of the elements are hashed against a string.

sy...@googlecode.com

unread,
Apr 27, 2013, 4:49:07 PM4/27/13
to sympy-...@googlegroups.com
Updates:
Labels: Combinatorics Milestone-Release0.7.3

Comment #2 on issue 3783 by asme...@gmail.com: Prufer.edges test depends
(No comment was entered for this change.)

sy...@googlecode.com

unread,
May 22, 2013, 2:07:33 PM5/22/13
to sympy-...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 3783 by smi...@gmail.com: Prufer.edges test depends on
fixed in a73a4ade523845a271676ac392196c41483baab3
Reply all
Reply to author
Forward
0 new messages