pyupgrade automatically upgrades syntax for newer versions of python. I ran the tool with --py311-plusand setup a pre-commit hook (which seems fast). Also used ruff --fix to remove the unecessary imports.
I had to rename the list method of Panda and PandaDFU to list_all, because it clashes with using list as a type now.
pyupgrade does seem to apply the fixes automatically - not sure if we want pre-commit to make changes without asking since we haven't setup Ruff to do that.
pyupgrade automatically upgrades syntax for newer versions of python. I ran the tool with
--py311-plus
and setup a pre-commit hook (which seems fast). Also usedruff --fix
to remove the unecessary imports.I had to rename thelist
method of Panda and PandaDFU tolist_all
, because it clashes with usinglist
as a type now.Steps:
pyupgrade --py311-plus
ruff --fix
PandaDFU.list()
method to end of file