From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28096 invoked by alias); 1 Sep 2011 23:13:20 -0000 Received: (qmail 28088 invoked by uid 22791); 1 Sep 2011 23:13:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Sep 2011 23:13:04 +0000 Received: by gxk23 with SMTP id 23so1914895gxk.0 for ; Thu, 01 Sep 2011 16:13:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.77.105 with SMTP id c69mr2219691yhe.113.1314918783569; Thu, 01 Sep 2011 16:13:03 -0700 (PDT) Received: by 10.236.34.162 with HTTP; Thu, 1 Sep 2011 16:13:03 -0700 (PDT) In-Reply-To: References: <1314198654-9008-1-git-send-email-ratmice@gmail.com> <1314198654-9008-6-git-send-email-ratmice@gmail.com> Date: Thu, 01 Sep 2011 23:18:00 -0000 Message-ID: Subject: Re: [PATCH 5/7] [python] API for macros: gdb.Objfile symtabs method. From: Matt Rice To: pmuldoon@redhat.com Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00022.txt.bz2 On Tue, Aug 30, 2011 at 6:07 AM, Phil Muldoon wrote: > matt rice writes: > > If there are no symtabs, why return an empty list? =A0Would Py_None make > more sense here. =A0And same rules apply to returning a Tuple, too, as > others. > the main reason here to return an empty list is just because things like (gdb) py for i in None: print "foo" Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' object is not iterable Error while executing Python code. thus you require an 'if' and python's if doesn't work as a one liner... such as (gdb) py for i in list(): print "foo" (gdb) If you would still like me to change it, no problem.