comtypes
comtypes copied to clipboard
Refactor from `%` string formatting to f-strings in every module.
We could replace % string formatting with f-strings wherever applicable, as was done in #654.
For details on f-string syntax, refer to the Python official documentation.
-
Most of the changes should follow these patterns:
- Replace
"...%s..." % foowithf"...{foo}..." - Replace
"...%r..." % foowithf"...{foo!r}..." - Replace
"...%x..." % foowithf"...{foo:x}..." - Replace
"...%d..." % foowithf"...{foo:d}..." - Replace
"...\\%s..." % foowithf"...\\{foo}..." - Replace
r"...\%s..." % foowithrf"...\{foo}..."
- Replace
-
There’s NO need to modify placeholders in logger method calls, as shown below. https://github.com/enthought/comtypes/blob/083c19e9fdc0f366df48ad448e897246f346ede0/comtypes/init.py#L137-L141
-
We welcome keeping changes as small as possible per pull request, as it makes it easier for reviewers to check the changes.
-
If your PR addresses multiple rules or files, reviewers might consider it a large change and suggest splitting it into multiple PRs.
TODO list
Under the comtypes/...
- [x]
comtypes/_comobject.py - [x]
comtypes/_memberspec.py - [x]
comtypes/_post_coinit/_cominterface_meta_patcher.py - [x]
comtypes/automation.py - [x]
comtypes/client/_code_cache.py - [x]
comtypes/client/_constants.py - [x]
comtypes/client/_events.py - [x]
comtypes/client/_generate.py - [x]
comtypes/client/lazybind.py - [x]
comtypes/errorinfo.py - [x]
comtypes/server/inprocserver.py - [x]
comtypes/server/register.py - [x]
comtypes/server/w_getopt.py - [x]
comtypes/tools/codegenerator/codegenerator.py - [x]
comtypes/tools/codegenerator/helpers.py - [x]
comtypes/tools/codegenerator/packing.py - [x]
comtypes/tools/tlbparser.py - [x]
comtypes/tools/typedesc.py - [x]
comtypes/typeinfo.py - [x]
comtypes/viewobject.py
Under the comtypes/test/...
- [x]
comtypes/test/__init__.py - [x]
comtypes/test/test_BSTR.py - [x]
comtypes/test/test_avmc.py - [x]
comtypes/test/test_casesensitivity.py - [x]
comtypes/test/test_collections.py - [x]
comtypes/test/test_comserver.py - [x]
comtypes/test/test_createwrappers.py - [ ]
comtypes/test/test_dispinterface.py - [ ]
comtypes/test/test_excel.py - [ ]
comtypes/test/test_outparam.py - [ ]
comtypes/test/test_safearray.py - [ ]
comtypes/test/test_sapi.py - [ ]
comtypes/test/test_server.py - [ ]
comtypes/test/test_urlhistory.py - [ ]
comtypes/test/test_variant.py - [ ]
comtypes/test/test_word.py