Serhiy Storchaka added the comment:

I think it will be better to call the close() method from the __exit__() method 
using _PyObject_CallMethodId(). It will allow to overload the close() method 
and get working context manager without overloading the __exit__() method. See 
issue16488 for example.

versions: +Python 3.4 -Python 3.3

Python tracker <>
Python-bugs-list mailing list

Reply via email to