Skip to content

Commit

Permalink
Use tuple unpacking instead of concatenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaph committed Oct 15, 2024
1 parent ead1eec commit bf0aabe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bin/add_help_to_readme.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/usr/bin/env python
import io

from contextlib import redirect_stdout, suppress
from pathlib import Path

from charla import cli


start = '<!-- START: DO NOT EDIT -->'
end = '<!-- END: DO NOT EDIT -->'
quote = '```'
Expand All @@ -21,6 +19,6 @@

p_start = readme_content.partition(start)[:2]
p_end = readme_content.partition(end)[1:]
p_all = p_start + (f'\n{quote}text\n{help_text}\n{quote}\n',) + p_end
p_all = (*p_start, f'\n{quote}text\n{help_text}\n{quote}\n', *p_end)

readme_file.write_text(''.join(p_all))

0 comments on commit bf0aabe

Please sign in to comment.