A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-June/054161.html below:

[Python-Dev] PEP 343 - next steps

[Python-Dev] PEP 343 - next steps [Python-Dev] PEP 343 - next stepsMichael Hudson mwh at python.net
Sun Jun 12 22:17:38 CEST 2005
Nick Coghlan <ncoghlan at gmail.com> writes:

> It also considers the possibility of using with statements in an RAII 
> style by acquiring the resource in __init__ or __new__ rather than
> __enter__.

While you can probably do this (after all, most of the time
__new__/__init__ and __enter__ will be called in rapid succession) I
really think the RAII meme doesn't apply to Python; you generally want
a resource to be acquired for a period of definite extent, and objects
in Python have indefinite extent, unlike C++ where automatic variables
have definite extent (Common Lisp terminology here).

I've gone on at length about this before:

     http://starship.python.net/crew/mwh/pep310/

Cheers,
mwh

-- 
 Have you considered downgrading your arrogance to a reasonable level?
        -- Erik Naggum, comp.lang.lisp, to yet another C++-using troll
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