Closed as not planned
Description
currently asyncio.iscoroutinefunction and inspect.iscoroutinefunction behave differently in confusing and hard to document ways. It's possible to bring them into alignment but I think it would be better to make asyncio.iscoroutinefunction
a deprecated alias of inspect.iscoroutinefunction
and remove asyncio.coroutines._is_coroutine
.
This is now possible with the recent removal of @asyncio.coroutine
and support for AsyncMock and other duck-type functions in inspect.iscoroutinefunction
the only caveats are - what should happen to users of the asyncio.coroutines._is_coroutine
mark? eg:
Lines 686 to 696 in 1c0cf0a
and all of these:
Lib/test/test_asyncio/test_base_events.py: m_socket.getaddrinfo._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_reader._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_writer._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_reader._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_writer._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_reader._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_writer._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: m_socket.getaddrinfo._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: m_socket.getaddrinfo._is_coroutine = False
Lib/test/test_asyncio/test_base_events.py: self.loop._add_reader._is_coroutine = False
Lib/test/test_asyncio/test_selector_events.py: self.loop.add_reader._is_coroutine = False
Lib/test/test_asyncio/test_subprocess.py: protocol.connection_made._is_coroutine = False
Lib/test/test_asyncio/test_subprocess.py: protocol.process_exited._is_coroutine = False
Lib/unittest/mock.py: mock._is_coroutine = asyncio.coroutines._is_coroutine
Lib/unittest/mock.py: # iscoroutinefunction() checks _is_coroutine property to say if an
Lib/unittest/mock.py: self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine
Metadata
Metadata
Assignees
Projects
Status
Done