From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5322 invoked by alias); 25 Mar 2008 18:53:57 -0000 Received: (qmail 5304 invoked by uid 22791); 25 Mar 2008 18:53:55 -0000 X-Spam-Check-By: sourceware.org Received: from aussmtpmrkps320.us.dell.com (HELO aussmtpmrkps320.us.dell.com) (143.166.224.254) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Mar 2008 18:53:36 +0000 X-IronPort-AV: E=Sophos;i="4.25,553,1199685600"; d="scan'208";a="353567879" Received: from unknown (HELO M31.equallogic.com) ([12.110.134.31]) by aussmtpmrkps320.us.dell.com with SMTP; 25 Mar 2008 13:53:34 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18409.18988.613477.542099@pkoning-laptop.equallogic.com> Date: Tue, 25 Mar 2008 19:31:00 -0000 From: Paul Koning To: jimb@red-bean.com Cc: tromey@redhat.com, bauerman@br.ibm.com, gdb@sourceware.org Subject: Re: repo to work on python scripting support References: <1205538908.6643.138.camel@localhost.localdomain> <1206369478.29533.15.camel@localhost.localdomain> <20080325114520.GA21688@caradoc.them.org> <8f2776cb0803251118o316d261erb340d67bb0580967@mail.gmail.com> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00226.txt.bz2 >>>>> "Jim" == Jim Blandy writes: Jim> It's worth putting some investment into the way arguments get Jim> handled, to make writing commands as easy as possible. Jim> I don't know the most Pythonish way of doing things, but it Jim> seems to me that Python could register not functions, but Jim> objects, to be callable with $(). You can make objects callable, but I don't know if that's the answer. Calling a class object is how you construct instances, by the way... An obvious Pythonic way of doing this is with default arguments, which allows a call to omit some of the arguments defined for the function. For example: def foo (arg1, arg2=None): if arg2 is None: arg2 = raw_input ("please supply arg2: ") paul