mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
2.4 defines groupby, so there's no need to define our own.
This commit is contained in:
parent
566b273a97
commit
6580fc535f
@ -27,6 +27,7 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
###
|
###
|
||||||
|
|
||||||
|
import sys
|
||||||
import new
|
import new
|
||||||
import random
|
import random
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ def trueCycle(iterable):
|
|||||||
if not yielded:
|
if not yielded:
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
|
|
||||||
|
if sys.version_info < (2, 4, 0):
|
||||||
def groupby(key, iterable):
|
def groupby(key, iterable):
|
||||||
if key is None:
|
if key is None:
|
||||||
key = lambda x: x
|
key = lambda x: x
|
||||||
|
Loading…
Reference in New Issue
Block a user