Skip to content

Conversation

miketheman
Copy link
Member

Not super glamorous, but updated the codebase to take advantage of Python 3.11 syntax.

Things like:

  • explicit object subclass
  • f-string syntax
  • yield from
  • set() => {}

Signed-off-by: Mike Fiedler [email protected]

Not super glamorous, but updated the codebase to take advantage of
Python 3.11 syntax.

Things like:

- explicit `object` subclass
- f-string syntax
- `yield from`
- `set()` => `{}`

Signed-off-by: Mike Fiedler <[email protected]>
@miketheman miketheman requested a review from a team as a code owner December 19, 2022 23:18
Signed-off-by: Mike Fiedler <[email protected]>
Run `pyupgrade` first so that any other lint checks have to pass on the
reformatted code.

Found a couple of stragglers in the root directory as well.

Signed-off-by: Mike Fiedler <[email protected]>
Comment on lines -951 to +952
"The user '{0}' isn't allowed to upload to project '{1}'. "
"See {2} for more information."
"The user '{}' isn't allowed to upload to project '{}'. "
"See {} for more information."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this become an f-string? I'm surprised it didn't catch this use of .format.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it has something to do with the complex usage of request.help_url(_anchor="project-name"), and quotations - there's a test that shows this should be a noop:
https://github.com/asottile/pyupgrade/blob/ff43f9a6ab4c37d0a89a4bb5ae338c2d0233b5eb/tests/features/fstrings_test.py#L34-L37

Comment on lines +964 to +965
"The given token isn't allowed to upload to project '{}'. "
"See {} for more information."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here.

@di di merged commit 5320917 into pypi:main Dec 20, 2022
@miketheman miketheman deleted the miketheman/upgrade-python-syntax branch December 20, 2022 16:05
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.

2 participants