[Python-Dev] Does anyone care enough about asyncore and asynchat to help adapt their APIs for Py3k?

Guido van Rossum guido at python.org
Thu Dec 6 01:12:54 CET 2007

On Dec 5, 2007 12:54 PM, Gary Herron <gherron at islandtraining.com> wrote:
> Guido van Rossum wrote:
> > The asyncore and asynchat modules are in a difficult position when it
> > comes to Python 3000. None of the core developers use it or
> > particularly care about it (AFAIK), and the API has problems because
> > it wasn't written to deal with bytes vs. unicode. E.g. in
> > http://bugs.python.org/issue1067, Thomas suggests that these modules
> > need to be rewritten to use bytes internally and have separate APIs to
> > handle (unicode) text as desired, similar to the way file I/O was
> > redesigned. Another alternative would be to make these modules deal
> > strictly in bytes, but that would probably vastly reduce their
> > usefulness (though I don't know -- as I said, I don't use them).

> I use asyncore/asynchat in one (proprietary) project of mine.  However,
> since the only thing I use them for is bytes, your suggested alternative
> (of bytes instead of strings) is fine with me, and seems the most
> natural choice.
> (In fact what I'm currently passing around is strings produced by
> cPickle,  but I'm assuming that the Python3 version of cPickle will
> create/consume bytes.  True?)

Right. Although it'll just be "pickle" -- if there's a C accelerator,
it'll be hidden from view, so you won't have to change the imported
name to get it.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list