Skip to content

Commit

Permalink
space literals without multiple quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshix-1 committed Oct 1, 2024
1 parent 69b3b1b commit b201822
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions typed_stream/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def run_program(options: Options) -> str | None: # noqa: C901

method: None | Callable[[object], object] = None
args: list[object] = []
for index, action in Stream(options.actions).map(str.strip).enumerate(1):
if action.startswith("_"):
for index, action in Stream(options.actions).enumerate(1):
if action.lstrip().startswith("_"):
return f"{index}: {action!r} isn't allowed to start with '_'."
args_left = (
count_required_positional_arguments(method) - len(args)
Expand Down Expand Up @@ -191,7 +191,10 @@ def run_program(options: Options) -> str | None: # noqa: C901
if not method:
return f"{action!r} needs to be a Stream method."
full_action_qual: str
if action in functions.__all__:
if action.isspace():
args.append(action)
full_action_qual = repr(action)
elif action in functions.__all__:
args.append(getattr(functions, action))
full_action_qual = f"typed_stream.functions.{action}"
elif action in collections.__all__:
Expand Down

0 comments on commit b201822

Please sign in to comment.