Introduce Self type
In #177, I stubbed out typing Self parameters, but I set Self = Any to maintain Python 3.8, 3.9 and 3.10 support. This PR closes the loop and uses typing.Self for that annotation. This yields a slight improvement in type safety.
This change does remove Python 3.8, 3.9 and 3.10 support.
Google thinks these are the release dates for the relevant Python versions:
- 3.8 (minimum previously) - October 2019, 5 1/2 years ago
- 3.9 - October 2020, 4 1/2 years ago
- 3.10 - October 2021, 3 1/2 years ago
- 3.11 (minimum in this PR) - October 2022, 2 1/2 years ago
I'd be OK dropping 3.8 support - 2019 was a while ago! But dropping 3.10 might be a bridge too far. Dunno.
The last version of Python which is currently supported is 3.9 - 3.9 EOL is 2025-10. e.g. Playwright tries to follow that support pattern for Python versions.
Hi! In aiortc (which depends on pyee) we support all non-EOL Python versions, so we would like to retain Python 3.9 compatibility until October 2025 :)