This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mgilson
Recipients Matt Gilson, mgilson, rhettinger, serhiy.storchaka
Date 2017-05-12.21:29:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494624593.76.0.348397452814.issue30346@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-05-12 21:29:53mgilsonsetrecipients: + mgilson, rhettinger, serhiy.storchaka, Matt Gilson
2017-05-12 21:29:53mgilsonsetmessageid: <1494624593.76.0.348397452814.issue30346@psf.upfronthosting.co.za>
2017-05-12 21:29:53mgilsonlinkissue30346 messages
2017-05-12 21:29:53mgilsoncreate