Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYLE: Prefer using f-strings #70

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhlegarreta
Copy link
Contributor

Prefer using f-strings.

Used the flynt package to convert as many instances as possible, then did a manual pass.

Take advantage of the commit to fix some messages and missing substitutions:

'syntax error in line %s line %d: \n%s\n%s' %
(
    module_name,
    exc_value[1][1],
    formatted_lines[-3],
    formatted_lines[-2]
)

and

raise ValueError(
    "Data in %s does not have the correct number of items")

Documentation:
https://peps.python.org/pep-0498/
https://pypi.org/project/flynt/

Prefer using f-strings.

Used the `flynt` package to convert as many instances as possible, then
did a manual pass.

Take advantage of the commit to fix some messages and missing
substitutions:
```
'syntax error in line %s line %d: \n%s\n%s' %
(
    module_name,
    exc_value[1][1],
    formatted_lines[-3],
    formatted_lines[-2]
)
```

and
```
raise ValueError(
    "Data in %s does not have the correct number of items")
```

Documentation:
https://peps.python.org/pep-0498/
https://pypi.org/project/flynt/
@jhlegarreta
Copy link
Contributor Author

Leaving as a draft until a version is tagged/released based on #67 (comment).

@jhlegarreta jhlegarreta marked this pull request as ready for review December 12, 2024 01:23
@jhlegarreta jhlegarreta marked this pull request as draft December 12, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant