in src/stepfunctions/steps/states.py [0:0]
def __init__(self, steps=[]):
"""
Args:
steps (list(State), optional): List of states to be chained in-order. (default: [])
"""
if not isinstance(steps, list):
raise TypeError("Chain takes a 'list' of steps. You provided an input that is not a list.")
self.steps = []
steps_expanded = []
[steps_expanded.extend(step) if isinstance(step, Chain) else steps_expanded.append(step) for step in steps]
for step in steps_expanded:
if steps_expanded.count(step) > 1:
raise DuplicateStatesInChain("Duplicate states in the chain.")
list(map(self.append, steps_expanded))