Modernize `serial/tools/list_ports_common.py`
This introduces the following changes:
* Add type annotations to `serial/tools/list_ports_common.py`.
The code was run through mypy in strict mode and passed,
but the annotations are not yet guaranteed and enforced
until more code is type-annotated
and mypy is added to the test suite.
* Run `serial/tools/list_ports_common.py` through multiple linters:
pyupgrade, isort, black, ruff, and flake8.
With the exception of double quotation marks,
all linters are satisfied with the file now.
* Remove `if __name__ == '__main__'` code,
which did not perform anything functionally useful.
* Remove `ListPortInfo.apply_usb_info()`,
which is not consistently used by platform-specific port-lister code
and does not represent significant functionality.
3 files changed