Skip to content

Commit 693c4f1

Browse files
authored
Mark Future._callbacks as a @property (#7829)
1 parent a27f15e commit 693c4f1

File tree

5 files changed

+1
-8
lines changed

5 files changed

+1
-8
lines changed

stdlib/asyncio/futures.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Future(Awaitable[_T], Iterable[_T]):
5555
def __del__(self) -> None: ...
5656
if sys.version_info >= (3, 7):
5757
def get_loop(self) -> AbstractEventLoop: ...
58+
@property
5859
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
5960
def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ...
6061
else:

tests/stubtest_allowlists/py310.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ ast.NameConstant.__new__
3434
ast.Num.__new__
3535
ast.Str.__new__
3636
asyncio.Future.__init__ # Usually initialized from c object
37-
asyncio.Future._callbacks # Usually initialized from c object
3837
asyncio.futures.Future.__init__ # Usually initialized from c object
39-
asyncio.futures.Future._callbacks # Usually initialized from c object
4038
builtins.dict.get
4139
builtins.float.__setformat__ # Internal method for CPython test suite
4240
builtins.property.__set_name__ # Doesn't actually exist

tests/stubtest_allowlists/py37.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ _dummy_threading
66
asyncio.AbstractEventLoop.run_in_executor # allowed to return a Future, changed in 3.8
77
asyncio.events.AbstractEventLoop.run_in_executor # allowed to return a Future, changed in 3.8
88
asyncio.Future.__init__ # Usually initialized from c object
9-
asyncio.Future._callbacks # Usually initialized from c object
109
asyncio.futures.Future.__init__ # Usually initialized from c object
11-
asyncio.futures.Future._callbacks # Usually initialized from c object
1210
asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omitted from the stub
1311
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
1412
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself

tests/stubtest_allowlists/py38.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ ast.NameConstant.__new__
1212
ast.Num.__new__
1313
ast.Str.__new__
1414
asyncio.Future.__init__ # Usually initialized from c object
15-
asyncio.Future._callbacks # Usually initialized from c object
1615
asyncio.futures.Future.__init__ # Usually initialized from c object
17-
asyncio.futures.Future._callbacks # Usually initialized from c object
1816
asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omitted from the stub
1917
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
2018
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself

tests/stubtest_allowlists/py39.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ ast.NameConstant.__new__
1616
ast.Num.__new__
1717
ast.Str.__new__
1818
asyncio.Future.__init__ # Usually initialized from c object
19-
asyncio.Future._callbacks # Usually initialized from c object
2019
asyncio.futures.Future.__init__ # Usually initialized from c object
21-
asyncio.futures.Future._callbacks # Usually initialized from c object
2220
builtins.dict.get
2321
builtins.float.__setformat__ # Internal method for CPython test suite
2422
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.

0 commit comments

Comments
 (0)