[issue4565] Rewrite the IO stack in C

Benjamin Peterson report at bugs.python.org
Wed Feb 25 20:34:51 CET 2009


Benjamin Peterson <benjamin at python.org> added the comment:

On Wed, Feb 25, 2009 at 10:15 AM, Antoine Pitrou <report at bugs.python.org> wrote:
>
> Antoine Pitrou <pitrou at free.fr> added the comment:
>
> I just took a quick look at Lib/abc.py and there's no way *I*'ll
> reimplement it in C :)

I don't blame you for that. :)

>
> The only workable approach would be:
> 1. rename the current would-be ABCs (IOBase, RawIOBase, etc.) with a
> leading underscore (_IOBase, _RawIOBase, etc.)
> 2. call abc.ABCMeta() with the right arguments to create heap-types
> derived from those base types
> 3. call XXXIOBase.register() with each of the concrete classes
> (BufferedReader, etc.) to register them with the ABCs created in 2

I think this is the best solution. We could also just move the Python
ABC's from _pyio to io.py and register() all the C IO classes, but
that would prevent the C implementation of IOBase from being used.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4565>
_______________________________________


More information about the Python-bugs-list mailing list