This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] Make gdb.search_memory accept keyword arguments.
El vie, 27-02-2009 a las 09:22 -0700, Tom Tromey escribiÃ:
> Thiago> I added documentation for memory searching. Or do you mean updating the
> Thiago> documentation for the keyword syntax?
>
> Actually I was confused and did not realize that the memory searching
> API had docs. Sorry about that.
No worries.
> Thiago> I was planning to add this to the beginning of the "Python API" section,
> Thiago> WDYT?
>
> Thiago> +You can get quick online help for @value{GDBN}'s Python API by issuing
> Thiago> +the command @kbd{python help (gdb)}. Functions and methods which have
> Thiago> +two or more optional arguments allow them to be specified using keyword
> Thiago> +syntax. This allows passing some optional arguments while skipping
> Thiago> +others. Example: @code{gdb.some_function ('foo', bar = 1, baz = 2)}.
>
> This looks nice to me.
>
> The first sentence and the remaining sentences don't seem to be
> directly related, though. Perhaps this ought to be 2 paragraphs.
Ok, if you don't mind having a one sentence paragraph.
> Thiago> Perhaps this means I should add keyword arguments to all functions (or
> Thiago> at least, the ones with at least one optional argument) instead of just
> Thiago> for functions with two or more optional arguments?
>
> We should follow whatever the typical Python practice is. Which I
> don't know :-)
Neither do I. :-)
> I do think the keywords ought to be documented in the manual.
> They are part of the API. This also means we'll have to be careful
> about naming them, just as we are with function and class names,
> because changing them will break things.
Agreed. I'm adding tests for the keywords to the testsuite, so that if
the API breaks the testsuite will tell.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center