Skip to content

Commit

Permalink
remove unneeded complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
rsalmei committed Apr 21, 2021
1 parent 3f458e2 commit a3b0769
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions alive_progress/animations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,9 @@ def lcm(a, b):
return reduce(lcm, nums)


def split_options(options, expects_tuple=False):
def split_options(options):
"""Split options that apply to dual elements, either duplicating or splitting."""
if not expects_tuple:
return options if isinstance(options, tuple) else (options, options)

if not isinstance(options, tuple):
return (options,), (options,)
if any(isinstance(elem, tuple) for elem in options):
return tuple(elem if isinstance(elem, tuple) else (elem,) for elem in options)
return options, options
return options if isinstance(options, tuple) else (options, options)


def spread_weighted(actual_length, naturals):
Expand Down

0 comments on commit a3b0769

Please sign in to comment.