From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28779 invoked by alias); 2 Sep 2011 00:56:17 -0000 Received: (qmail 28755 invoked by uid 22791); 2 Sep 2011 00:56:16 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 00:56:02 +0000 X-Loopcount0: from 10.175.216.249 From: To: , CC: Date: Fri, 02 Sep 2011 01:07:00 -0000 Subject: RE: [PATCH 5/7] [python] API for macros: gdb.Objfile symtabs method. Message-ID: <09787EF419216C41A903FD14EE5506DD015343C124@AUSX7MCPC103.AMER.DELL.COM> References: <1314198654-9008-1-git-send-email-ratmice@gmail.com> <1314198654-9008-6-git-send-email-ratmice@gmail.com> In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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/msg00024.txt.bz2 >> If there are no symtabs, why return an empty list? =A0Would Py_None make= =20 >> more sense here. =A0And same rules apply to returning a Tuple, too, as=20 >> 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. There's a precedent: gdb.Type.fields() returns an empty list if the type do= esn't have fields. I was wondering why that is, but your explanation gives= the reason. paul