Skip to content

Add mixins module to asyncio #6789

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 10 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ array: 2.7-
ast: 2.7-
asynchat: 2.7-
asyncio: 3.4-
asyncio.mixins: 3.10-
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sobolevn In theory, mypy should support this: python/mypy#11069, but in practice, asyncio.exceptions is also ignored in the stubtest allowlists. You need to do the same with asyncio.mixins for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

asyncio.compat: 3.4-3.6
asyncio.exceptions: 3.8-
asyncio.format_helpers: 3.7-
Expand Down
7 changes: 7 additions & 0 deletions stdlib/asyncio/mixins.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import threading
from typing import NoReturn

_global_lock: threading.Lock

class _LoopBoundMixin:
def __init__(self, *, loop: NoReturn = ...) -> None: ...
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ asyncio.runners # Added in Python 3.7
asyncio.staggered # Added in Python 3.8
asyncio.threads # Added in Python 3.9
asyncio.trsock # Added in Python 3.8
asyncio.mixins # Added in Python 3.10
builtins.str.maketrans
cmath.log
collections.AsyncGenerator.ag_await
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ asyncio.futures.Future._callbacks # Usually initialized from c object
asyncio.staggered # Added in Python 3.8
asyncio.threads # Added in Python 3.9
asyncio.trsock # Added in Python 3.8
asyncio.mixins # Added in Python 3.10
builtins.dict.get
builtins.str.maketrans
cmath.log
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ asyncio.Future._callbacks # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
asyncio.futures.Future._callbacks # Usually initialized from c object
asyncio.threads # Added in Python 3.9
asyncio.mixins # Added in Python 3.10
builtins.dict.get
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ asyncio.Future.__init__ # Usually initialized from c object
asyncio.Future._callbacks # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
asyncio.futures.Future._callbacks # Usually initialized from c object
asyncio.mixins # Added in Python 3.10
builtins.dict.get
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
Expand Down