Skip to content

Conversation

antazoey
Copy link
Contributor

@antazoey antazoey commented Jun 2, 2021

Migrating code to be more py3-y by using f-strs everywhere where it makes sense. Note, it does not always make sense, such as in the following conditions:

  • You are interpolating an expression involving slashes /
  • You are building a dict of values to pass into format
  • You are using a str-template pattern

F-str makes sense in most cases however.

@antazoey antazoey requested review from timabrmsn, alanag13 and peterbriggs42 and removed request for timabrmsn June 2, 2021 19:13
@github-actions
Copy link

github-actions bot commented Jun 2, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@antazoey antazoey requested a review from timabrmsn June 2, 2021 19:13
@alanag13
Copy link
Contributor

alanag13 commented Jun 2, 2021

@unparalleled-js I think you could get this to be something that tox style would do for you automatically if we modified .pre-commit-config.yaml to pass different args to pyupgrade, namely:

 args: ["--py36-plus"]

https://github.com/asottile/pyupgrade#f-strings

@antazoey
Copy link
Contributor Author

antazoey commented Jun 2, 2021

@unparalleled-js I think you could get this to be something that tox style would do for you automatically if we modified .pre-commit-config.yaml to pass different args to pyupgrade, namely:

 args: ["--py36-plus"]

https://github.com/asottile/pyupgrade#f-strings

It works

@antazoey antazoey merged commit a2214e0 into master Jun 2, 2021
@antazoey antazoey deleted the fstrs-everywhere branch June 2, 2021 22:20
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants