[issue33762] Make tempfiles subclass IOBase

2019-12-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: Looking at the tempfile code more, I agree with Serhiy that changing it should be rejected. Python is a duck-typed language (essentially what Martin said). People should not be over-zealous in using instance checks. The doc specifically says that Temporary

[issue33762] Make tempfiles subclass IOBase

2019-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have doubts that making _TemporaryFileWrapper a subclass of IOBase can make it simpler. It can make it more complex. _TemporaryFileWrapper is a proxy class with the __getattr__ method which not just return attributes of the underlying file, but wraps met

[issue33762] Make tempfiles subclass IOBase

2019-12-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: TemporaryFile() returns an instance of _TemporaryFileWrapper. isinstance(TemporaryFile(), io.IOBase) is a sensible thing to do and would be True if _TemporaryFileWrapper subclassed the appropriate io base file. The base class for IDLE's stdxxx pseudofiles d