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 petri.lehtinen
Recipients Jiba, petri.lehtinen
Date 2012-05-16.11:17:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337167061.18.0.491177452811.issue14828@psf.upfronthosting.co.za>
In-reply-to
Content
You're right, the result over a set would be unpredictable.

The point of the itertools module is to be able to a) cope with massive amounts of data and b) be a set of tools instead of complete solutions for all problems.

Because of both of the points above, groupby() doesn't load all the data into memory or attempt to sort the data by itself. Furthermore, there's no way for groupby() to know whether the iterable it's passed is going to yield sorted or unsorted data.

It's your responsibility to know whether the iterable you're passing is already sorted or not, and sort it first, if it's possible and there's a need to do so.
History
Date User Action Args
2012-05-16 11:17:41petri.lehtinensetrecipients: + petri.lehtinen, Jiba
2012-05-16 11:17:41petri.lehtinensetmessageid: <1337167061.18.0.491177452811.issue14828@psf.upfronthosting.co.za>
2012-05-16 11:17:40petri.lehtinenlinkissue14828 messages
2012-05-16 11:17:40petri.lehtinencreate