This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: repo to work on python scripting support


>>>>> "Jim" == Jim Blandy <jimb@red-bean.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]