You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: requests.structures.LookupDict.__setattr__ is inconsistent, stub argument "attr" should be positional-only (rename with a leading double underscore, i.e. "__name")
Stub: at line 20
def (self: requests.structures.LookupDict[_VT`1], attr: builtins.str, value: _VT`1)
Runtime:
def (self, name, value, /)
error: requests.structures.LookupDict.__setattr__ is inconsistent, stub argument "value" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 20
def (self: requests.structures.LookupDict[_VT`1], attr: builtins.str, value: _VT`1)
Runtime:
def (self, name, value, /)
error: mock.mock._Call.__ne__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 51
def (mock.mock._Call, builtins.object) -> builtins.bool
Runtime:
def (self, value, /)
error: frozendict.frozendict.__contains__ is inconsistent, stub argument "key" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 18
def (frozendict.frozendict[_KT`1, _VT`2], builtins.object) -> builtins.bool
Runtime:
def (self, key, /)
error: contextvars.Context.__getitem__ is inconsistent, stub argument "key" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 41
def [_T] (contextvars.Context, contextvars.ContextVar[_T`-1]) -> _T`-1
Runtime:
def (self, key, /)
error: MySQLdb._mysql.connection.__delattr__ is inconsistent, stub argument "name" should be positional-only (rename with a leading double underscore, i.e. "__name")
Stub: at line 66
def (MySQLdb._mysql.connection, Any) -> Any
Runtime:
def (self, name, /)
error: MySQLdb._mysql.connection.__setattr__ is inconsistent, stub argument "name" should be positional-only (rename with a leading double underscore, i.e. "__name")
Stub: at line 67
def (self: MySQLdb._mysql.connection, name: Any, value: Any) -> Any
Runtime:
def (self, name, value, /)
error: MySQLdb._mysql.connection.__setattr__ is inconsistent, stub argument "value" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 67
def (self: MySQLdb._mysql.connection, name: Any, value: Any) -> Any
Runtime:
def (self, name, value, /)
error: MySQLdb._mysql.result.__delattr__ is inconsistent, stub argument "name" should be positional-only (rename with a leading double underscore, i.e. "__name")
Stub: at line 79
def (MySQLdb._mysql.result, Any) -> Any
Runtime:
def (self, name, /)
error: MySQLdb._mysql.result.__setattr__ is inconsistent, stub argument "name" should be positional-only (rename with a leading double underscore, i.e. "__name")
Stub: at line 80
def (self: MySQLdb._mysql.result, name: Any, value: Any) -> Any
Runtime:
def (self, name, value, /)
error: MySQLdb._mysql.result.__setattr__ is inconsistent, stub argument "value" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 80
def (self: MySQLdb._mysql.result, name: Any, value: Any) -> Any
Runtime:
def (self, name, value, /)
error: psycopg2._psycopg.Column.__eq__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 95
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Column.__ge__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 96
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Column.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 97
None
Runtime:
def (self, key, /)
error: psycopg2._psycopg.Column.__gt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 99
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Column.__le__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 100
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Column.__lt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 102
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Column.__ne__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 103
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__eq__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [205](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:205)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__ge__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [206](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:206)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line [207](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:207)
None
Runtime:
def (self, key, /)
error: psycopg2._psycopg.Notify.__gt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [208](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:208)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__le__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [210](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:210)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__lt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [212](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:212)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Notify.__ne__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line [213](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:213)
None
Runtime:
def (self, value, /)
error: psycopg2._psycopg.Xid.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line [268](https://github.com/python/typeshed/runs/5281379912?check_suite_focus=true#step:6:268)
None
Runtime:
def (self, key, /)
error: psycopg2.extensions.Column.__eq__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 95
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Column.__ge__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 96
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Column.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 97
None
Runtime:
def (self, key, /)
error: psycopg2.extensions.Column.__gt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 99
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Column.__le__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 100
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Column.__lt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 102
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Column.__ne__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 103
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__eq__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 205
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__ge__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 206
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 207
None
Runtime:
def (self, key, /)
error: psycopg2.extensions.Notify.__gt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 208
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__le__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 210
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__lt__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 212
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Notify.__ne__ is inconsistent, stub argument "other" should be positional-only (rename with a leading double underscore, i.e. "__value")
Stub: at line 213
None
Runtime:
def (self, value, /)
error: psycopg2.extensions.Xid.__getitem__ is inconsistent, stub argument "index" should be positional-only (rename with a leading double underscore, i.e. "__key")
Stub: at line 268
None
Runtime:
def (self, key, /)
Maybe we should consider reverting stubtest to allowing positional-only inconsistencies on dunders? While I don't mind the extra stdlib fixes we've made as a result, this feels more like busy work than usual / seems unlikely to really help users. cc @AlexWaygood
Even more than in your message, @hauntsaninja -- you missed the aiofiles hits:
Details
MYPYPATH=/home/runner/work/typeshed/typeshed/stubs/aiofiles /tmp/tmpj8lmgc95/bin/python -m mypy.stubtest --ignore-missing-stub --custom-typeshed-dir /home/runner/work/typeshed/typeshed aiofiles --allowlist /home/runner/work/typeshed/typeshed/stubs/aiofiles/@tests/stubtest_allowlist.txt
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.read is an "async def" function in the stub, but not at runtime
Stub: at line 11
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.read1 is an "async def" function in the stub, but not at runtime
Stub: at line [32](https://github.com/python/typeshed/runs/5281379804?check_suite_focus=true#step:6:32)
def (self: aiofiles.threadpool.binary.AsyncBufferedIOBase, builtins.int =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.readinto is an "async def" function in the stub, but not at runtime
Stub: at line 12
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]) -> typing.Coroutine[Any, Any, Union[builtins.int, None]]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.readline is an "async def" function in the stub, but not at runtime
Stub: at line 13
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.readlines is an "async def" function in the stub, but not at runtime
Stub: at line 14
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int =) -> typing.Coroutine[Any, Any, builtins.list[builtins.bytes]]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.seek is an "async def" function in the stub, but not at runtime
Stub: at line 15
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int, builtins.int =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.truncate is an "async def" function in the stub, but not at runtime
Stub: at line 18
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.write is an "async def" function in the stub, but not at runtime
Stub: at line 20
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.bytes, builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedIOBase.writelines is an "async def" function in the stub, but not at runtime
Stub: at line 21
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, typing.Iterable[Union[builtins.bytes, builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]]) -> typing.Coroutine[Any, Any, None]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncBufferedReader.peek is an "async def" function in the stub, but not at runtime
Stub: at line [38](https://github.com/python/typeshed/runs/5281379804?check_suite_focus=true#step:6:38)
def (self: aiofiles.threadpool.binary.AsyncBufferedReader, builtins.int =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line [42](https://github.com/python/typeshed/runs/5281379804?check_suite_focus=true#step:6:42) in file /tmp/tmpj8lmgc[95](https://github.com/python/typeshed/runs/5281379804?check_suite_focus=true#step:6:95)/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.read is an "async def" function in the stub, but not at runtime
Stub: at line 11
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.readinto is an "async def" function in the stub, but not at runtime
Stub: at line 12
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]) -> typing.Coroutine[Any, Any, Union[builtins.int, None]]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.readline is an "async def" function in the stub, but not at runtime
Stub: at line 13
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.bytes]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.readlines is an "async def" function in the stub, but not at runtime
Stub: at line 14
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int =) -> typing.Coroutine[Any, Any, builtins.list[builtins.bytes]]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.seek is an "async def" function in the stub, but not at runtime
Stub: at line 15
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, builtins.int, builtins.int =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.truncate is an "async def" function in the stub, but not at runtime
Stub: at line 18
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.write is an "async def" function in the stub, but not at runtime
Stub: at line 20
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, Union[builtins.bytes, builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.binary.AsyncFileIO.writelines is an "async def" function in the stub, but not at runtime
Stub: at line 21
def (self: aiofiles.threadpool.binary._UnknownAsyncBinaryIO, typing.Iterable[Union[builtins.bytes, builtins.bytearray, builtins.memoryview, array.array[Any], mmap.mmap, ctypes._CData]]) -> typing.Coroutine[Any, Any, None]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.read is an "async def" function in the stub, but not at runtime
Stub: at line 10
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.str]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.readline is an "async def" function in the stub, but not at runtime
Stub: at line 11
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, builtins.int =) -> typing.Coroutine[Any, Any, builtins.str]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.readlines is an "async def" function in the stub, but not at runtime
Stub: at line 12
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, builtins.int =) -> typing.Coroutine[Any, Any, builtins.list[builtins.str]]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.seek is an "async def" function in the stub, but not at runtime
Stub: at line 13
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, builtins.int, builtins.int =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.truncate is an "async def" function in the stub, but not at runtime
Stub: at line 16
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.write is an "async def" function in the stub, but not at runtime
Stub: at line 18
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, builtins.str) -> typing.Coroutine[Any, Any, builtins.int]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
error: aiofiles.threadpool.text.AsyncTextIOWrapper.writelines is an "async def" function in the stub, but not at runtime
Stub: at line 19
def (self: aiofiles.threadpool.text.AsyncTextIOWrapper, typing.Iterable[builtins.str]) -> typing.Coroutine[Any, Any, None]
Runtime: at line 42 in file /tmp/tmpj8lmgc95/lib/python3.9/site-packages/aiofiles/threadpool/utils.py
def (self, *args, **kwargs)
stubtest failed for aiofiles
Maybe we should consider reverting stubtest to allowing positional-only inconsistencies on dunders? While I don't mind the extra stdlib fixes we've made as a result, this feels more like busy work than usual / seems unlikely to really help users. cc @AlexWaygood
I'd rather not see the stdlib regress tbh, but I also don't really feel like I have the energy to sweep through all the third-party stubs. Could we add a command-line option to switch it off, and use that option for the third-party stubs?
^FWIW, I actually feel worse about the async-mismatch test I introduced. All (I think) of the aiofiles hits are from that check rather than the dunder-pos-only check, and I think they're mostly false positives due to aiofiles doing some crazy dynamic stuff with decorators. If the test fails completely when checking an async library, it's not much good.
Then again, maybe we can reduce false positives by only raising an error if a runtime async function is sync in the stub, and ignore the vice versa. The aiofiles false positives were mostly caused by cases where stubtest thought it saw a sync function at runtime, and an async function in the stub.
Activity
hauntsaninja commentedon Feb 22, 2022
Quite a few:
Details
hauntsaninja commentedon Feb 22, 2022
Maybe we should consider reverting stubtest to allowing positional-only inconsistencies on dunders? While I don't mind the extra stdlib fixes we've made as a result, this feels more like busy work than usual / seems unlikely to really help users. cc @AlexWaygood
AlexWaygood commentedon Feb 22, 2022
Even more than in your message, @hauntsaninja -- you missed the
aiofileshits:Details
AlexWaygood commentedon Feb 22, 2022
I'd rather not see the stdlib regress tbh, but I also don't really feel like I have the energy to sweep through all the third-party stubs. Could we add a command-line option to switch it off, and use that option for the third-party stubs?
hauntsaninja commentedon Feb 22, 2022
I think it also causes some problems on stdlib stubs, that we haven't seen yet because they come once we add python/mypy#12203
We'll get there one day :-) The fixes you've made are great and I'd be surprised if the dunder positional-only args already fixed regressed too much.
(Also you may have picked up on this, but in general I'm hesitant to add configuration options to things)
Downgrade stubtest a little
Downgrade stubtest a little (#7346)
AlexWaygood commentedon Feb 22, 2022
My hope is that I've already fixed most of those 🙂
Yeah, I get that☹️
AlexWaygood commentedon Feb 22, 2022
^FWIW, I actually feel worse about the async-mismatch test I introduced. All (I think) of the
aiofileshits are from that check rather than the dunder-pos-only check, and I think they're mostly false positives due toaiofilesdoing some crazy dynamic stuff with decorators. If the test fails completely when checking an async library, it's not much good.Then again, maybe we can reduce false positives by only raising an error if a runtime async function is sync in the stub, and ignore the vice versa. The
aiofilesfalse positives were mostly caused by cases where stubtest thought it saw a sync function at runtime, and an async function in the stub.hauntsaninja commentedon Feb 22, 2022
Hmm, good point, this might be a good idea.
AlexWaygood commentedon Feb 22, 2022
python/mypy#12234