Skip to content

concurrent.futures: update for py39, minor fixes #4503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2020

Conversation

hauntsaninja
Copy link
Collaborator

Note the new parameter doesn't actually exist on the base class, even
though it's documented as that being the case. Asked about it in https://bugs.python.org/issue39349

hauntsaninja added 2 commits August 30, 2020 15:26
Note the new parameter doesn't actually exist on the base class, even
though it's documented as that being the case. Asked about it in https://bugs.python.org/issue39349
@@ -46,14 +46,17 @@ class Future(Generic[_T]):
def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...

class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
def submit(self, __fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that changing it to a positional-only argument is correct, at least not without a version check. In 3.8.5, there is an explicit check for a fn argument. While a warning is generated, it is accepted. Of course, it's a bit weird, since the checking code is within an abstract method, so it will likely never get executed.

Copy link
Collaborator Author

@hauntsaninja hauntsaninja Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, weird the documentation doesn't mentioned the break in backwards compatibility. The concrete classes do do similar checks. I'll make an exception to #3693 here

@hauntsaninja hauntsaninja requested a review from srittau August 31, 2020 19:27
@srittau srittau merged commit 48c8939 into python:master Aug 31, 2020
@hauntsaninja hauntsaninja deleted the conc branch August 31, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants