Message352938
While it may not appear to be a permutation, python already considers it one:
graingert@onomastic:~$ cat test_assert_permutation.py
import itertools
import unittest
from decimal import Decimal
from fractions import Fraction
class TestAssertPermutation(unittest.TestCase):
def assertPermutation(self, a, b):
return self.assertIn(tuple(a), itertools.permutations(b))
def test_do_not_look_like_permutations(self):
self.assertPermutation(
[Decimal(3), 5, Fraction(12, 4)], [3.0, 3, Fraction(15, 3)]
)
if __name__ == "__main__":
unittest.main()
graingert@onomastic:~$ python3 test_assert_permutation.py -v
test_do_not_look_like_permutations (__main__.TestAssertPermutation) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK |
|
Date |
User |
Action |
Args |
2019-09-21 09:55:01 | graingert | set | recipients:
+ graingert, georg.brandl, rhettinger, terry.reedy, gregory.p.smith, rbcollins, ezio.melotti, r.david.murray, michael.foord, martin.panter, serhiy.storchaka, vitaly, aldencolerain |
2019-09-21 09:55:01 | graingert | set | messageid: <1569059701.19.0.45651632796.issue27071@roundup.psfhosted.org> |
2019-09-21 09:55:01 | graingert | link | issue27071 messages |
2019-09-21 09:55:00 | graingert | create | |
|