Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:: [': 0.04; 'languages,': 0.04; 'languages.': 0.04; 'class,': 0.07; 'context': 0.07; 'works.': 0.09; 'python': 0.11; 'c++.': 0.16; 'destructor.': 0.16; 'dynamic,': 0.16; 'easier.': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'scope.': 0.16; 'subject:type': 0.16; 'subject:which': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'subject:] ': 0.20; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'subject:like': 0.24; "haven't": 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'compared': 0.30; 'that.': 0.31; 'quite': 0.32; 'something': 0.35; 'objects': 0.35; 'c++': 0.36; 'subject:data': 0.36; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'tell': 0.60; 'managers': 0.61; 'management': 0.65; 'charset:windows-1252': 0.65; 'yes': 0.68; 'miss': 0.74; 'allocation': 0.74; 'routines': 0.84; 'forgotten': 0.91 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Fri, 30 Jan 2015 20:35:09 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: [OT] fortran lib which provide python like data type References: <4822a519-5814-433b-88ad-9bea8a2f83e3@googlegroups.com> <3c31aec4-0c0a-4eb9-aff4-e7b7aa76da21@googlegroups.com> <3d3ef587-a62d-4024-964c-0ac8be023ca3@googlegroups.com> <54CBBA93.9020404@gmail.com> <1841390178444352281.903812sturla.molden-gmail.com@news.gmane.org> In-Reply-To: <1841390178444352281.903812sturla.molden-gmail.com@news.gmane.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422675320 news.xs4all.nl 2969 [2001:888:2000:d::a6]:34263 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:84933 On 01/30/2015 04:12 PM, Sturla Molden wrote: > Michael Torrie wrote: > >> Yes I can tell you haven't used C++. Compared to C, I've always found >> memory management in C++ to be quite a lot easier. The main reason is >> that C++ guarantees objects will be destroyed when going out of scope. >> So when designing a class, you put any allocation routines in the >> constructor, and put deallocation routines in the destructor. And it >> just works. This is something I miss in other languages, even Python. > > Python has context managers for that. Right I had forgotten about that. That's a good solution for dynamic, GC languages.