Move choices_length to shared folder

This commit is contained in:
Ludovic Stephan 2019-06-26 09:57:16 -07:00 committed by Martin Pépin
parent 730611039b
commit 4da5add25a
No known key found for this signature in database
GPG key ID: E7520278B1774448
4 changed files with 8 additions and 12 deletions

5
shared/utils.py Normal file
View file

@ -0,0 +1,5 @@
from functools import reduce
def choices_length(choices):
return reduce(lambda m, choice: max(m, len(choice[0])), choices, 0)