This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add is_closing() to asyncio.StreamWriter.
Type: enhancement Stage: resolved
Components: asyncio Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder: Add StreamWriter.wait_closed()
View: 32391
Assigned To: asvetlov Nosy List: asvetlov, aymeric.augustin, yselivanov
Priority: normal Keywords:

Created on 2017-09-16 11:48 by aymeric.augustin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg302335 - (view) Author: Aymeric Augustin (aymeric.augustin) * Date: 2017-09-16 11:48
asyncio.StreamWriter wraps a transport. The first three document methods of asyncio.BaseTransport are close(), is_closing() and get_extra_info().

It is somewhat surprising that StreamWriter provides close() and get_extra_info() but not is_closing(). I'm proposing that StreamWriter implement is_closing() as well.

It's as simple as:

    def is_closing(self):
        return self._transport.is_closing()

Perhaps it was simply missed in https://github.com/python/asyncio/pull/291.

It's trivial to work around this omission with stream_writer.transport.is_closing().

I'm only suggesting to add it for consistency.
msg308777 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-12-20 19:08
Makes sense.
msg308778 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2017-12-20 19:09
OK.
msg318066 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-05-29 18:35
Done in 32391.
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75672
2018-05-29 18:35:44yselivanovsetstatus: open -> closed
superseder: Add StreamWriter.wait_closed()
messages: + msg318066

resolution: out of date
stage: resolved
2017-12-20 19:09:26yselivanovsetmessages: + msg308778
2017-12-20 19:08:53asvetlovsetassignee: asvetlov

messages: + msg308777
nosy: + asvetlov
2017-09-16 11:48:32aymeric.augustincreate