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

Use f-strings for string formatting #3257

Closed
mariosasko opened this issue Nov 12, 2021 · 5 comments · Fixed by #3277
Closed

Use f-strings for string formatting #3257

mariosasko opened this issue Nov 12, 2021 · 5 comments · Fixed by #3277
Assignees
Labels
good first issue Good for newcomers

Comments

@mariosasko
Copy link
Collaborator

mariosasko commented Nov 12, 2021

f-strings offer better readability/performance than str.format and %, so we should use them in all places in our codebase unless there is good reason to keep the older syntax.

NOTE FOR CONTRIBUTORS: To avoid large PRs and possible merge conflicts, do 1-3 modules per PR. Also, feel free to ignore the files located under datasets/*.

@mariosasko mariosasko added the good first issue Good for newcomers label Nov 12, 2021
@Carlosbogo
Copy link
Contributor

Hi, I would be glad to help with this. Is there anyone else working on it?

@Mehdi2402
Copy link
Contributor

Hi, I would be glad to work on this too.

@Mehdi2402
Copy link
Contributor

#self-assign

@mariosasko
Copy link
Collaborator Author

Hi @Carlosbogo,

would you be interested in replacing the .format and % syntax with f-strings in the modules in the datasets directory since @Mehdi2402 has opened a PR that does that for all the other directories?

@Carlosbogo
Copy link
Contributor

Oh I see. I will be glad to help with the datasets directory then.

Carlosbogo added a commit to Carlosbogo/datasets that referenced this issue Nov 17, 2021
Used f-strings to format the .py files in the dataset folder
lhoestq pushed a commit that referenced this issue Nov 22, 2021
* Finishes #3257

Used f-strings to format the .py files in the dataset folder

* Fix style

* Fix hkcancor dataset

Co-authored-by: Mario Šaško <mario@huggingface.co>
Co-authored-by: mariosasko <mariosasko777@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
3 participants