Skip to content

Commit

Permalink
state: minor bugfix in repr(mf.optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hartmann committed May 5, 2023
1 parent 176e18d commit 1a1a403
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/miniflask/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ def __call__(self, state, event): # pylint: disable=redefined-outer-name
def str(self, asciicodes=True, color_attr=attr):
if not asciicodes:
color_attr = lambda x: '' # noqa: E731 no-lambda
return color_attr('dim') + "'" + str(self.type) + "' or '" + "None" + "' ⟶ " + color_attr('reset') + str(self.dependencies)
alt = "None" if isinstance(self.type, list) else "[]"
return color_attr('dim') + "'" + str(self.type) + "' or '" + alt + "' ⟶ " + color_attr('reset')

def __str__(self):
return self.str()
Expand Down

0 comments on commit 1a1a403

Please sign in to comment.