Movatterモバイル変換
[0]ホーム
[Python-Dev] Why does IOBase.__del__ call .close?
Nick Coghlanncoghlan at gmail.com
Wed Jun 11 14:38:13 CEST 2014
On 11 Jun 2014 12:31, "Antoine Pitrou" <antoine at python.org> wrote:>> Le 10/06/2014 21:30, Nikolaus Rath a écrit :>>>>> For me, having __del__ call close() does not qualify as a reasonable>> default implementation unless close() is required to be idempotent>> (which one could deduce from the documentation if one tries to, but it's>> far from clear).>>> close() should indeed be idempotent on all bundled IO classimplementations (otherwise it's a bug), and so should it preferably onthird-party IO class implementations.>> If you want to improve the documentation on this, you're welcome toprovide a patch!We certainly assume idempotent close() behaviour in various places, so ifthat expectation isn't currently clear in the docs, suggestions forimproved wording would definitely be appreciated!Cheers,Nick.-------------- next part --------------An HTML attachment was scrubbed...URL: <http://mail.python.org/pipermail/python-dev/attachments/20140611/4324709e/attachment.html>
More information about the Python-Devmailing list
[8]ページ先頭