Skip to content

Commit

Permalink
Simplify logic by yielding the comma separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 23, 2024
1 parent d7e9341 commit e47eded
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3924,12 +3924,11 @@ def _render(chunks, decimal, comma):
first = decimal is None or not first_item.endswith(decimal)
for nc in chunks:
if nc == decimal:
yield f" {nc}"
first = False
elif first:
yield f"{comma} {nc}"
else:
yield f" {nc}"
yield comma
yield f" {nc}"


@typechecked
def join(
Expand Down

0 comments on commit e47eded

Please sign in to comment.