[Python-Dev] Simplify the file-like-object interface (Replacement for print in Python 3.0) (original) (raw)

Paul Moore p.f.moore at gmail.com
Wed Sep 7 14:07:23 CEST 2005


On 9/6/05, Steven Bethard <steven.bethard at gmail.com> wrote:

I'd also prefer something along the lines of Fredrik's suggestion, but I don't write enough C code to understand Paul's last point. Could someone briefly explain why mixins wouldn't work in C code?

I had in mind "it would be complicated and messy, and probably no easier than just implementing all of the extra methods by hand" rather than "it's impossible". Sorry for being unclear.

I haven't written many C extensions, either, so I may be misremembering. Also, the biggest extension I wrote, which does implement a file-like object, was written when Python 1.4/1.5 was current, and (still) uses the C API from then. (BTW, that's a great tribute to the backward-compatibility that Python provides!)

Paul.



More information about the Python-Dev mailing list