gratuitous new features in 2.0

Andrew Dalke dalke at acm.org
Mon Aug 28 14:11:58 EDT 2000


Niels Diepeveen wrote:
>Andrew Dalke schreef:
>> Hmm, there is a problem mixing the two mechanisms.  Some of my code
>> just passes the 'write' function/method, and not the file object.  This
>> could not be passed to a library expecting a file object for use with
>> '>>', at least, not without a wrapper object.
>
>Don't you have that problem already with some of the standard library?

Actually, yes, but there it's only a slight problem.  I've become rather
adept at writing adapters :)

>That would be tricky, because print doesn't only need the .write()
>method, but also the .softspace flag. I suppose it could use
>write.__self__.softspace or something, but eh...

I didn't think about the need for softspace.  I suppose if the
attribute lookup doesn't exist, the "print >>" will use the normal
default of 1.

I'm still sticking with 'write' :)

                    Andrew
                    dalke at acm.org








More information about the Python-list mailing list