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/033013.html below:

[Python-Dev] With statement

[Python-Dev] With statement [Python-Dev] With statementSamuele Pedroni pedronis@bluewin.ch
Wed, 5 Feb 2003 18:16:14 +0100
From: "Oren Tirosh" <oren-py-d@hishome.net>
> > 2) Without the ability to define a scope at will, RAiI becomes less useful.
>
> local f=open('sdaskdfjhaslk')
> ...
> del l
>
> Deleting this kind of variable (whether we call it local or something
> else) means you want its __del__ executed now. It is also an assertion
> that its reference count is supposed to be 1 at this point. This not only
> gives you the ability to define a scope at will, it lets you create
> scopes dynamically. It's probably useful for more than just RAiI. Perhaps
> too useful.

it is not about variables, it is about objects, too much fragile magic

local f=open('sdaskdfjhaslk')
w = f.write

w(...)

del f # ???





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