Open emiliadecaudin opened 1 week ago
Big fan of this PR. However I'm against the bump to 3.9.
This is a library after all, the core functionality is not affected and so bumping will only harm users stuck on older python versions.
There is a way out of this, you could either split the types into a stub file or use typing_extensions like so:
from typing import TYPE_CHECKING:
if TYPE_CHECKING:
# look ma. No runtime errors on older python!
from typing_extensions import ...etc
Understood; I don't have experience writing type-safe code before 3.9 so I'm less familiar with how to write proper type hints before the changes introduced in that version. I'm at a conference right now but I will try to dive in after this week and test against 3.7.
Understood; I don't have experience writing type-safe code before 3.9 so I'm less familiar with how to write proper type hints before the changes introduced in that version. I'm at a conference right now but I will try to dive in after this week and test against 3.7.
I'm not a maintainer of this package. But I'd you'd like I can help out and make a PR targeting your branch.
Hi @emiliadecaudin, thanks for your contribution!
I second @JoaquimEsteves feedback, although Python 3.8 is going EOL in October, it would be great to still support older versions as this module is used by quite few projects.
This does not mean we have to backport this feature in previous versions. We simply need to support the case in which an older Python interpreter is used.
As type hints are a non functional feature, we can definitely skip support for older Python versions. Just make this functionality optional. :wink:
I've confirmed before submitting this pull request that all tests pass.
This pull request does two things:
thread
andprocess
decorators in theconcurrent
sub-package. This allows users of this package to properly treat the output of a decorated function as aFuture
orProcessFuture
, respectively, instead of the type-checker treating the function signature as identical to the original function.I am a big fan of this package and would be eager to help add more type-hinting for the rest of the package as well as adding mypy/ruff linting!