This is the mail archive of the mailing list for the Archer 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: [python] Make gdb.search_memory accept keyword arguments.

El jue, 26-02-2009 a las 12:06 -0700, Tom Tromey escribiÃ:
> >>>>> "Thiago" == Thiago Jung Bauermann <> writes:
> Thiago> For functions which take more than one optional argument, I enabled
> Thiago> keyword syntax which provides a way to specify some optional arguments
> Thiago> while skipping others. For instance, you can say:
> Thiago> gdb.some_function ('foo', bar = 1, baz = 2)
> The memory searching stuff needs documentation.  I intend to be a nag
> about this from now on :-)

I added documentation for memory searching. Or do you mean updating the
documentation for the keyword syntax?

> And if you add keywords to other modules, please make sure to update
> the corresponding docs.

I was planning to add this to the beginning of the "Python API" section,

+You can get quick online help for @value{GDBN}'s Python API by issuing
+the command @kbd{python help (gdb)}.  Functions and methods which have
+two or more optional arguments allow them to be specified using keyword
+syntax.  This allows passing some optional arguments while skipping
+others.  Example: @code{gdb.some_function ('foo', bar = 1, baz = 2)}.

Also, I believe that for Python functions/methods in general keyword
arguments are a standard feature. It's for functions and methods
implemented in C that you need to change your code a little (but not
much) to accept the syntax.

Perhaps this means I should add keyword arguments to all functions (or
at least, the ones with at least one optional argument) instead of just
for functions with two or more optional arguments?
Thiago Jung Bauermann
IBM Linux Technology Center

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