Skip to content

Update from pyupgrade to --py37-plus

Stuart Prescott requested to merge stuart/python-debian:tmp/pyupgrade37 into master

At DebConf, @cjwatson made the excellent suggestion of using pyupgrade to see what could be incrementally and safely improved in this codebase. The current minimum Python version declared is 3.7, so this uses pyupgrade --py37-plus and then a little manual tidying of now-unneeded imports from typing.

The main changes that pyupgrade is pushing are:

  • using builtin types for typing (e.g. dict rather than typing.Dict)
  • using | instead of typing.Union
  • using | None instead of typing.Optional
  • using f-strings in a few places
  • using .format rather than %

Merge request reports

Loading