A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-April/088302.html below:

[Python-Dev] Possible py3k io wierdness

[Python-Dev] Possible py3k io wierdness [Python-Dev] Possible py3k io wierdnessNick Coghlan ncoghlan at gmail.com
Mon Apr 6 00:54:20 CEST 2009
Antoine Pitrou wrote:
> 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.

Note that we already do that in a couple of places where it makes sense
- in those cases the underscore is there to tell *clients* of the class
"don't call this directly", but it is still explicitly documented as
part of the subclassing API.

(the only example I can find at the moment is in asynchat, but I thought
there were a couple of more common ones than that - hopefully I'll think
of them later)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4