Message358220
Actually things are more complex. TemporaryFile is not a class, it is a function, so it does not make sense to use it with isinstance(). And if add support for TemporaryFile, NamedTemporaryFile and SpooledTemporaryFile should be supported too.
It may be easier to use a virtual subclassing: register IOBasePayload with a class which has an __instancecheck__() method which checks the existence of attributes "read" and "close". |
|
Date |
User |
Action |
Args |
2019-12-10 20:05:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, asvetlov, martin.panter, wumpus, Dutcho, sergiitk |
2019-12-10 20:05:51 | serhiy.storchaka | set | messageid: <1576008351.36.0.935000037611.issue33762@roundup.psfhosted.org> |
2019-12-10 20:05:51 | serhiy.storchaka | link | issue33762 messages |
2019-12-10 20:05:51 | serhiy.storchaka | create | |
|