Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:: [': 0.04; 'languages,': 0.04; 'class,': 0.07; 'context': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'works.': 0.09; 'python': 0.11; 'c++.': 0.16; 'destructor.': 0.16; 'easier.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 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:X-Complaints-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; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'tell': 0.60; 'managers': 0.61; 'management': 0.65; 'yes': 0.68; 'miss': 0.74; 'allocation': 0.74; 'routines': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sturla Molden Subject: Re: [OT] fortran lib which provide python like data type Date: Fri, 30 Jan 2015 23:12:29 +0000 (UTC) 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 58-175-11.connect.netcom.no User-Agent: NewsTap/4.0.1 (iPad) X-: 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422659559 news.xs4all.nl 2946 [2001:888:2000:d::a6]:50052 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84923 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.