This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bquinlan
Recipients bquinlan, pitrou
Date 2009-04-12.11:50:39
SpamBayes Score 5.2553517e-12
Marked as misclassified No
Message-id <1239537041.45.0.943211184648.issue5700@psf.upfronthosting.co.za>
In-reply-to
Content
>> - FileIO is implemented in Python in _pyio.py so that it can have the
>>    same base class as the other Python-implemented files classes

> Is it really necessary (e.g. to pass the tests)?

It is necessary to make MI work. With out it the inheritance graph looks
like this (using _pyio):


io.IOBase    _pyio.IOBase
    |              |
io.FileIO       MyMixin
    |              |
     \            /
      \          /
       \        /
         MyClass

If you call MyClass.flush() with this hierarchy then it will propagate
to io.IOBase. Since io.IOBase doesn't call super().flush() in its flush
implementation (because it has no super class), flush propagation would
stop and MyMixin.flush wouldn't be called.

There are other ways you could solve this, of course, like getting
io.IOBase to call super().flush and ignore any errors that it gets.

But it seems like this is the right way to fix this problem anyway - as
a user, I would expect isinstance(FileIO(...), IOBase) but that is not
currently the case with _pyio.
History
Date User Action Args
2009-04-12 11:50:41bquinlansetrecipients: + bquinlan, pitrou
2009-04-12 11:50:41bquinlansetmessageid: <1239537041.45.0.943211184648.issue5700@psf.upfronthosting.co.za>
2009-04-12 11:50:40bquinlanlinkissue5700 messages
2009-04-12 11:50:39bquinlancreate