asyncio: remove overly specific protocols#10984
Conversation
The _warn parameter to these methods is just there to work around some finalization issues and should never be used by users. In addition, these protocols are out of date (the "stacklevel" argument is not used by current CPython main). I don't think we gain anything by trying to maintain these protocol definitions.
This comment has been minimized.
This comment has been minimized.
|
Maybe we can just remove |
|
That might be good, yes. I'm not sure what value we get from putting |
|
I think stubtest actually already doesn't care whether |
|
After a quick grep: We have 16 instances of |
Sounds good! I'm pretty confident stubtest won't complain, because of https://github.com/python/mypy/blob/544e6ce119ec6bdd5eabab53a433264c98dc7d9c/mypy/stubtest.py#L1377 |
|
One reason to keep it: https://docs.python.org/3/reference/datamodel.html#object.__del__ says
A type checker or other kind of linter might want to enforce this rule, but to do so, it needs to know whether |
|
And relatedly, removing |
In that case, we might want to remove it from stubtest's |
Agree. For this PR though, I think I'd prefer to just pretend the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
The _warn parameter to these methods is just there to work around
some finalization issues and should never be used by users. In
addition, these protocols are out of date (the "stacklevel" argument
is not used by current CPython main). I don't think we gain anything
by trying to maintain these protocol definitions.