Author dholth
Recipients dholth
Date 2020-04-09.03:47:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586404042.0.0.215231917986.issue40235@roundup.psfhosted.org>
In-reply-to
Content
The io documentation says:

IOBase is also a context manager and therefore supports the with statement. In this example, file is closed after the with statement’s suite is finished—even if an exception occurs:

with open('spam.txt', 'w') as file:
    file.write('Spam and eggs!')


I read this to mean that my own subclass of io.BufferedIOBase would call close() when used as a context manager.

Instead, it is necessary to provide an implementation of __exit__ that calls close() to get this behavior.

The documentation lists Mixin Methods, but I couldn't find a definition of the term "Mixin Methods" in the docs.
History
Date User Action Args
2020-04-09 03:47:22dholthsetrecipients: + dholth
2020-04-09 03:47:22dholthsetmessageid: <1586404042.0.0.215231917986.issue40235@roundup.psfhosted.org>
2020-04-09 03:47:21dholthlinkissue40235 messages
2020-04-09 03:47:21dholthcreate