ITADN

List Does Not Support OrderedSet For Arithmetic/Logical Operations

#81Closedb0ssi 创建于 2024-04-30
B
b0ssicommented
AUR release: `2.0.3-4` Python: `3.12.3` The following tests fail after building the current (`2.0.3-4`) AUR release. The problem seems to be `SUB`, `ADD`, `AND`, `OR` between `list` and `OrderedSet`. Order seems to be key: The inverse (`OrderedSet [+/-/&/|] list`) works fine. Failing tests: ``` ......E......E...............E.E ====================================================================== ERROR: test_difference_with_iterable (tests.test_orderedset.TestOrderedset.test_difference_with_iterable) ---------------------------------------------------------------------- Traceback (most recent call last): File "<home>/.local/share/pikaur/aur_repos/python-orderedset/src/orderedset-2.0.3/tests/test_orderedset.py", line 276, in test_difference_with_iterable self.assertEqual([3, 2, 4, 1] - OrderedSet([2, 4]), OrderedSet([3, 1])) ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ TypeError: unsupported operand type(s) for -: 'list' and 'OrderedSet' ====================================================================== ERROR: test_intersection_with_iterable (tests.test_orderedset.TestOrderedset.test_intersection_with_iterable) ---------------------------------------------------------------------- Traceback (most recent call last): File "<home>/.local/share/pikaur/aur_repos/python-orderedset/src/orderedset-2.0.3/tests/test_orderedset.py", line 271, in test_intersection_with_iterable self.assertEqual([1, 2, 3] & OrderedSet([3, 2]), OrderedSet([2, 3])) ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ TypeError: unsupported operand type(s) for &: 'list' and 'OrderedSet' ====================================================================== ERROR: test_symmetric_difference_with_iterable (tests.test_orderedset.TestOrderedset.test_symmetric_difference_with_iterable) ---------------------------------------------------------------------- Traceback (most recent call last): File "<home>/.local/share/pikaur/aur_repos/python-orderedset/src/orderedset-2.0.3/tests/test_orderedset.py", line 261, in test_symmetric_difference_with_iterable self.assertEqual(oset1 ^ [1], OrderedSet([])) ~~~~~~^~~~~ File "lib/orderedset/_orderedset.pyx", line 323, in orderedset._orderedset._OrderedSet.__xor__ return (self - other) | (other - self) TypeError: unsupported operand type(s) for -: 'list' and 'OrderedSet' ====================================================================== ERROR: test_union_with_iterable (tests.test_orderedset.TestOrderedset.test_union_with_iterable) ---------------------------------------------------------------------- Traceback (most recent call last): File "<home>/.local/share/pikaur/aur_repos/python-orderedset/src/orderedset-2.0.3/tests/test_orderedset.py", line 251, in test_union_with_iterable self.assertEqual([2] | oset1, OrderedSet([2, 1])) ~~~~^~~~~~~ TypeError: unsupported operand type(s) for |: 'list' and 'OrderedSet' ---------------------------------------------------------------------- Ran 32 tests in 0.004s FAILED (errors=4) ```
关闭于 2024-04-30 4 条评论