Improve various signatures that shouldn't be async def, but currently are (#7491)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
Alex Waygood
2022-03-19 03:54:39 +00:00
committed by GitHub
parent 37a981920f
commit 5c44ae4f8c
10 changed files with 44 additions and 17 deletions

View File

@@ -23,6 +23,7 @@ typing.IO.truncate
typing.IO.write
typing.IO.writelines
_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.Bytes.__new__
ast.Ellipsis.__new__
@@ -106,8 +107,6 @@ xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signatur
xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
_collections_abc.AsyncGenerator.asend
_collections_abc.AsyncGenerator.athrow
_collections_abc.Coroutine.send
_collections_abc.Coroutine.throw
_collections_abc.Generator.send

View File

@@ -11,6 +11,10 @@ asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitt
builtins.float.__setformat__ # Internal method for CPython test suite
builtins.str.maketrans
cmath.log
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
collections.AsyncGenerator.ag_frame
@@ -89,6 +93,8 @@ tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
typing.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
typing.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491
builtins.memoryview.__iter__ # C type that implements __getitem__
builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only

View File

@@ -15,6 +15,10 @@ builtins.dict.get
builtins.float.__set_format__ # Internal method for CPython test suite
builtins.str.maketrans
cmath.log
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
collections.AsyncGenerator.ag_frame

View File

@@ -19,6 +19,10 @@ asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omit
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
builtins.dict.get
builtins.float.__set_format__ # Internal method for CPython test suite
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
collections.AsyncGenerator.ag_frame

View File

@@ -21,6 +21,10 @@ asyncio.futures.Future.__init__ # Usually initialized from c object
asyncio.futures.Future._callbacks # Usually initialized from c object
builtins.dict.get
builtins.float.__set_format__ # Internal method for CPython test suite
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
collections.AsyncGenerator.ag_frame

View File

@@ -246,6 +246,10 @@ xml.parsers.expat.expat_CAPI
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
_collections_abc.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
_collections_abc.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
_collections_abc.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
_collections_abc.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
_pydecimal.* # See comments in file
_weakref.ProxyType.__bytes__ # Doesn't really exist
ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796