Message293574
Tracking which group the grouper _should_ be on using an incrementing integer seems to work pretty well.
In additional to the tests in `test_itertools.py`, I've gotten the following tests to pass:
class TestGroupBy(unittest.TestCase):
def test_unpacking(self):
iterable = 'AAAAABBBBB'
(_, a), (_, b) = groupby(iterable)
self.assertEqual(list(a), [])
self.assertEqual(list(b), [])
def test_weird_iterating(self):
g = groupby('AAAABBBBAAAAABBBBB')
_, a = next(g)
_, b = next(g)
_, aa = next(g)
self.assertEqual(list(a), [])
self.assertEqual(list(b), [])
self.assertEqual(list(aa), list('AAAAA'))
If I was to submit this as a PR,
1. where would I want to add these tests?
2. should I update the documentation for the "equivalent" python version to match exactly? |
|
Date |
User |
Action |
Args |
2017-05-12 21:29:53 | mgilson | set | recipients:
+ mgilson, rhettinger, serhiy.storchaka, Matt Gilson |
2017-05-12 21:29:53 | mgilson | set | messageid: <1494624593.76.0.348397452814.issue30346@psf.upfronthosting.co.za> |
2017-05-12 21:29:53 | mgilson | link | issue30346 messages |
2017-05-12 21:29:53 | mgilson | create | |
|