jaraco / keyring

MIT License
1.24k stars 152 forks source link

simplify and fix typing of priority() #666

Closed dimbleby closed 6 months ago

dimbleby commented 6 months ago

as currently typed, mypy complains:

keyring/backends/fail.py:18: error: Signature of "priority" incompatible with supertype "KeyringBackend"  [override]
keyring/backends/fail.py:18: note:      Superclass:
keyring/backends/fail.py:18: note:          classproperty[float]
keyring/backends/fail.py:18: note:      Subclass:
keyring/backends/fail.py:18: note:          classproperty[int]

etc

but per https://peps.python.org/pep-0484/#the-numeric-tower, if you want float | int, floatdoes just fine. And now mypy is not unhappy with the typing of priority().

jaraco commented 6 months ago

Aha. I addressed this issue in #667 and other typing issues in earlier commits, but I took a different approach. Let me resolve the conflicts and see what the new diff is.