[Python-Dev] Draft PEP: Deprecate codecs.StreamReader and codecs.StreamWriter

Antoine Pitrou solipsis at pitrou.net
Thu Jul 7 16:28:07 CEST 2011


On Thu, 7 Jul 2011 06:53:50 +0000 (UTC)
Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Benjamin Peterson <benjamin <at> python.org> writes:
> 
> > 
> > 2011/7/6 Nick Coghlan <ncoghlan <at> gmail.com>:
> 
> > > The API of the resulting object is the same (i.e. they're file-like
> > > objects). The behavioural differences are due to cases where the
> > > codec-specific classes are currently broken.
> > 
> > Yes, but as we all know too well, people are surely relying on
> > whatever behavior there is, broken or not.
> 
> There's also the fact that code which currently runs under 2.x and 3.x would
> stop working if codecs.StreamReader/StreamWriter were to go away.

That's a fact of life for any deprecation. But it only stops working
*after* the deprecation period has expired. And deprecated stuff can
actually stay in for a long time, depending on its popularity.

The main point of the PEP, IMO, is actually the deprecation itself. By
deprecating, we signal that something isn't actively maintained
anymore, and that a (allegedly better) alternative is available.
I think that's a very reasonable thing to do, regardless of whether or
not the "thing" actually gets removed in a later version.

Regards

Antoine.




More information about the Python-Dev mailing list