Skip to content

Instantly share code, notes, and snippets.

@baileywickham
Created May 23, 2021 03:25
Show Gist options
  • Save baileywickham/a07c2babd4daa89ffdec10ca7c854113 to your computer and use it in GitHub Desktop.
Save baileywickham/a07c2babd4daa89ffdec10ca7c854113 to your computer and use it in GitHub Desktop.
def _max(values, func=None):
if not func:
return max(values)
maybeMax = values[0]
for v in values:
if func(v, maybeMax):
maybeMax = v
return maybeMax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment