Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.003 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'c++,': 0.07; 'memory.': 0.07; 'problem?': 0.07; 'subject:code': 0.07; 'lawrence': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '23,': 0.16; 'any.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'malloc': 0.16; 'materially': 0.16; 'throw': 0.16; 'subject:python': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'cc:addr:python.org': 0.22; 'case.': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'dec': 0.30; 'returned': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'another': 0.32; "can't": 0.35; 'except': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'provide': 0.64; "how's": 0.74; "'new'": 0.84; 'different.': 0.84; 'thing,': 0.91; 'to:none': 0.92; 'remember,': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=FfjKiL1Z9B+XlpSOFLJ+6S9/2VAb9mLGxH2ZgTry+rw=; b=0m5E7ofv1XYSiS6fSFQE3iwsdKRhLCOt75uxl20+QM9CawMgeU/EqE/Z/lLXRRq8uN hiGLwv5XFDztuehgzEwpBW1Mg1YhDYSQb00pNjt5mlVJaCnIPDrQn/fgRqhM5Mkfjf5P CsmQb1WMzWpIDR1KfhuQnEnzw6A8XlZIyDbmI7o2HHUfwC+SxXtByWgNrSknf0iT8cuH zqnBhqw4BfO6AUKFhC+H5aAKne3QWquolrJZbIR4Ut4DKGObTclPlLiy8nPsn39CGJwt zB6VG740CRFg7FxGNQYgSWnn92rlTb7p6u2wUo+it41xblTZPK94lUTmbKNXTzgALN7+ zZDw== MIME-Version: 1.0 X-Received: by 10.66.197.164 with SMTP id iv4mr23498881pac.18.1387770327298; Sun, 22 Dec 2013 19:45:27 -0800 (PST) In-Reply-To: References: <20131222221125.GA44179@cskk.homeip.net> Date: Mon, 23 Dec 2013 14:45:27 +1100 Subject: Re: cascading python executions only if return code is 0 From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387770336 news.xs4all.nl 2908 [2001:888:2000:d::a6]:50067 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62588 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: memory.get(1234) 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