aiosmtpd icon indicating copy to clipboard operation
aiosmtpd copied to clipboard

Stop inheriting from `StreamReaderProtocol`?

Open pepoluan opened this issue 4 years ago • 3 comments
trafficstars

I was in the process of eyeballing the docs and fixing things when I came upon a :ref: that steadfastly refused to resolve:

:class:`asyncio.StreamReaderProtocol`

After hunting around, apparently that class was last documented in Python 3.6: https://docs.python.org/3.6/library/asyncio-stream.html#streamreaderprotocol

It's gone since Python 3.7, that's why the :ref: won't resolve.

Digging deeper, I found bpo-37639 with comment from @asvetlov (I'm assuming the same person, apologies if not):

We are striving to remove it from public API step by step: documentation-deprecation-removal.

If you really need the class -- please copy-paste the source lines into your project and use the copy on your own.

So, will we stop inheriting from that class and as suggested, just copy-and-paste the source lines?

I fear that one day things will blow up if this class's definition got removed and/or remade... which is why I'm adding the [tech-debt] label there.

pepoluan avatar Nov 22 '20 06:11 pepoluan

Correct. The removal process can take long (many years) but still. For Python 3.8 I tried to make a deep refactoring of async stream classes. The PR was reverted because it produced too many incompatibilities with private-but-used-by-third-party internal details.

asvetlov avatar Nov 22 '20 11:11 asvetlov

I'll earmark this for 2.0, because there's a remote possibility of things breaking (e.g., if aiosmtpd is implemented by someone that expected SMTP to inherit from StreamReaderProtocol)

pepoluan avatar Jan 07 '21 04:01 pepoluan

So ... I made a branch: https://github.com/pepoluan/aiosmtpd/tree/embed-streamreaderprotocol

pepoluan avatar Feb 28 '21 16:02 pepoluan