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

*: Automated changes from pyupgrade #3403

Merged
merged 9 commits into from
Jun 25, 2024
Merged

Commits on Jun 13, 2024

  1. *: Remove redundant (object) base classes

    This was only necessary in python 3.
    
    This change was made with a version of pyupgrade that was modified
    to perform only this change.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    04ebadd View commit details
    Browse the repository at this point in the history
  2. *: Use set literals and comprehensions where applicable

    These features have been available since Python 2.7.
    
    This change was made with a version of pyupgrade modified to perform
    only this change, then postprocessed with black.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    50358ac View commit details
    Browse the repository at this point in the history
  3. *: Use dict comprehensions where applicable

    Another feature that's been around since Python 2.7
    Automated change with modified pyupgrade and black.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    9f0a7fd View commit details
    Browse the repository at this point in the history
  4. *: Use OSError instead of its aliases

    Various errors were merged into OSError in Python 3.4.
    
    Automated change with modified pyupgrade.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    e98b09f View commit details
    Browse the repository at this point in the history
  5. *: Use default argument for str.encode()

    I had missed that this became hard-coded to utf-8 in py3k,
    instead of being overridable as in python 2.
    
    Automated change with modified pyupgrade.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    6c4d751 View commit details
    Browse the repository at this point in the history
  6. wsgi: Avoid deprecated typing.Text alias

    This alias existed only for python 2 compatibility.
    This commit was partially made by pyupgrade and then I manually fixed
    the unused import.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    ad277a7 View commit details
    Browse the repository at this point in the history
  7. *: More small pyupgrade cleanups

    - Unpack list comprehension
    - Redundant calls to str() on string literals
    - Unnecessary args to super()
    
    With the previous commits, this brings us up to
    pyupgrade --py3-plus --keep-percent-format
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    39346ce View commit details
    Browse the repository at this point in the history
  8. lint: Set black target version to 3.8+

    This makes black use trailing commas consistently across the codebase.
    Without this, it uses certain trailing commas only in files that
    contain fstrings (because this marks them as requiring Python 3.6+).
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    90ae304 View commit details
    Browse the repository at this point in the history
  9. *: Switch from percent formatting to f-strings

    Automated change using pyupgrade in two passes (once to go from percent
    formatting to str.format, then to go from str.format to f-strings),
    followed by black.
    
    This left a few uses of str.format for unknown reasons.
    bdarnell committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    f7818e7 View commit details
    Browse the repository at this point in the history