Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'c++,': 0.07; 'memory.': 0.07; 'problem?': 0.07; 'subject:code': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'language.': 0.14; '23,': 0.16; 'any.': 0.16; 'malloc': 0.16; 'materially': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'throw': 0.16; 'subject:python': 0.16; 'exception': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'mon,': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'dec': 0.30; 'returned': 0.30; 'code': 0.31; 'another': 0.32; "can't": 0.35; 'except': 0.35; 'something': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'new': 0.61; 'our': 0.64; 'provide': 0.64; '1st': 0.74; "how's": 0.74; 'day': 0.76; "'new'": 0.84; 'different.': 0.84; 'received:2': 0.84; 'remembering': 0.84; 'thing,': 0.91; 'remember,': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: cascading python executions only if return code is 0 Date: Mon, 23 Dec 2013 03:54:53 +0000 References: <20131222221125.GA44179@cskk.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-193-30.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387770906 news.xs4all.nl 2896 [2001:888:2000:d::a6]:54494 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62589 On 23/12/2013 03:45, Chris Angelico wrote: > On Mon, Dec 23, 2013 at 2:43 PM, Mark Lawrence wrote: >> Another C thing to complain about, with functions like malloc the status >> code and value returned are one and the same thing, except that NULL is >> failure in this case. > > How's that a problem? Python has the same: Remembering to check it? > > memory.get(1234) You learn something new every day or April 1st come early? > > will return a bit of memory, or None if it can't get any. Not > materially different. Remember, C doesn't have exceptions. In C++, the > 'new' operator will throw an exception if it can't provide memory. > > ChrisA > -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence