def shorter(*choices):
     '''Return the choice that has the fewest ops. In case of a tie,
     the expression listed first is selected.'''
     if not has_variety(choices):
         return choices[0]
     return min(choices, key=measure)
Пример #2
0
 def shorter(*choices):
     '''Return the choice that has the fewest ops. In case of a tie,
     the expression listed first is selected.'''
     if not has_variety(choices):
         return choices[0]
     return min(choices, key=measure)