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/2003-February/032927.html below:

[Python-Dev] With statement

[Python-Dev] With statementNeal Norwitz neal@metaslash.com
Tue, 04 Feb 2003 12:51:39 -0500
On Tue, Feb 04, 2003 at 05:19:39PM -0000, Duncan Booth wrote:
> On 4 Feb 2003 at 17:02, Moore, Paul wrote:
> > # You do realise you can't use a raw file object here really? 
> 
> Unless of course the file object sprouted an __exit__ method.
> It's probably worth including the pro's and con's of that in 
> your PEP.
> 
> I can see people falling into the trap of expecting the file 
> object to 'do the obvious thing' here (Neal Norwitz being the 
> first, but almost certainly not the last).

I was actually assuming that ultimately we'd just add a few methods to
objects (like file & Lock).  I see no benefit to add new builtins for
autoclosefile and synchronized.  It seems easier and more
straightforward to add the special methods to the objects.

Neal



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