mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 793 forks source link

Update collection literals and comprehensions #2108

Closed Avasam closed 1 year ago

Avasam commented 1 year ago

Extracted from, and improved over #2100 These were found by running ruff . --select=C4 --exclude=build --exclude=Pythonwin/Scintilla --exclude=adodbapi Documentation: https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4

This PR uses more modern collection literals and comprehensions where applicable. There's some expected performance gains here from the use of comprehensions and less function call overhead. On top of often more concise syntax