commaai / panda

code powering the comma.ai panda
MIT License
1.52k stars 757 forks source link

use pyupgrade to update syntax #1889

Closed incognitojam closed 6 months ago

incognitojam commented 6 months ago

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 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.

Steps:

incognitojam commented 6 months ago

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.