[Python-Dev] Possible py3k io wierdness

Antoine Pitrou solipsis at pitrou.net
Sun Apr 5 19:45:50 CEST 2009


James Y Knight <foom <at> fuhm.net> writes:
> 
> It seems that a separate method "_internal_close" should've been  
> defined to do the actual closing of the file, and the close() method  
> should've been defined on the base class as "self.flush();  
> self._internal_close()" and never overridden.

I'm completely open to changes as long as there is a reasonable consensus around
them. Your proposal looks sane, although the fact that a semi-private method
(starting with an underscore) is designed to be overriden in some classes is a
bit annoying.

I'd also like to have some advice from Guido, since he was one of the driving
forces behind the specification and the original Python implementation.

Regards

Antoine.




More information about the Python-Dev mailing list