Skip to content
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

Stubtest failed on Tue Feb 22 2022 #7344

Closed
github-actions bot opened this issue Feb 22, 2022 · 9 comments · Fixed by #7346
Closed

Stubtest failed on Tue Feb 22 2022 #7344

github-actions bot opened this issue Feb 22, 2022 · 9 comments · Fixed by #7346

Comments

@github-actions
Copy link
Contributor

Stubtest runs are listed here: https://github.com/python/typeshed/actions/workflows/stubtest.yml

@hauntsaninja
Copy link
Collaborator

Quite a few:

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, /)

@hauntsaninja
Copy link
Collaborator

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
Copy link
Member

Even more than in your message, @hauntsaninja -- you missed the aiofiles hits:

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

@AlexWaygood
Copy link
Member

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?

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented 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)

hauntsaninja pushed a commit to hauntsaninja/typeshed that referenced this issue Feb 22, 2022
Fixes python#7344 for now.

As discussed in that issue, I think it might make sense to revert the
change to check positional-only arguments on dunders for now, since it
seems to be mostly busywork and has very little benefit for end users.

However, that'll happen on stubtest master, which typeshed isn't yet
ready for.
hauntsaninja added a commit that referenced this issue Feb 22, 2022
Fixes #7344 for now.

As discussed in that issue, I think it might make sense to revert the
change to check positional-only arguments on dunders for now, since it
seems to be mostly busywork and has very little benefit for end users.

However, that'll happen on stubtest master, which typeshed isn't yet
ready for.

Co-authored-by: hauntsaninja <>
@AlexWaygood
Copy link
Member

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

My hope is that I've already fixed most of those 🙂

(Also you may have picked up on this, but in general I'm hesitant to add configuration options to things)

Yeah, I get that ☹️

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 22, 2022

^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.

@hauntsaninja
Copy link
Collaborator

only raising an error if a runtime async function is sync in the stub

Hmm, good point, this might be a good idea.

@AlexWaygood
Copy link
Member

only raising an error if a runtime async function is sync in the stub

Hmm, good point, this might be a good idea.

python/mypy#12234

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 a pull request may close this issue.

2 participants