[aiofiles] Fix NamedTemporaryFile name type - #16162
Conversation
This comment has been minimized.
This comment has been minimized.
|
Please remove the tests. In typeshed, we only add regression tests for functions and classes which are known to have caused complex problems in the past, or where stubs are difficult to get right. 100% test coverage for typeshed is neither necessary nor desirable, as it would lead to code duplication. See |
|
Removed the regression test in 72d696c as requested. I reran |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
| loop: AbstractEventLoop | None = None, | ||
| executor: Executor | None = None, | ||
| ) -> AiofilesContextManager[AsyncTextIOWrapper]: ... | ||
| ) -> AiofilesContextManager[_NamedAsyncTextIOWrapper]: ... |
There was a problem hiding this comment.
This is incorrect, it returns a bytes name with NamedTemporaryFile(suffix=b""). Probably this should be generic over AnyStr?
Fixes #13551.
Narrows
nametostronly on wrappers returned byaiofiles.tempfile.NamedTemporaryFile(), while retaining the broader type on general async file wrappers.OpenAI Codex was used to prepare this change.