Mercurial > pytave
changeset 173:28dc607532c2
doc: Clarify and clean up docstrings for all oct files
* pycall.cc, pyeval.cc, pyexec.cc: Reword summary to clarify differences
between the functions. Use Octave docstring style. Add @example and
@seealso sections.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 07 Apr 2016 15:26:53 -0700 |
parents | 29d9da90afcf |
children | 053253436eb6 |
files | pycall.cc pyeval.cc pyexec.cc |
diffstat | 3 files changed, 38 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/pycall.cc Thu Apr 07 14:51:18 2016 -0700 +++ b/pycall.cc Thu Apr 07 15:26:53 2016 -0700 @@ -39,27 +39,23 @@ DEFUN_DLD (pycall, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} pycall (@var{func})\n\ -@deftypefnx {Loadable Function} {@var{x} =} pycall (@var{func})\n\ -@deftypefnx {Loadable Function} {@var{x} =} pycall (@var{func}, @var{arg1}, @var{arg2}, @dots{})\n\ -Execute method of a Python module.\n\ +@deftypefn {} {} pycall (@var{func})\n\ +@deftypefnx {} {@var{x} =} pycall (@var{func})\n\ +@deftypefnx {} {@var{x} =} pycall (@var{func}, @var{arg1}, @var{arg2}, @dots{})\n\ +Call a Python function or callable, passing Octave values as arguments.\n\ \n\ Examples:\n\ @example\n\ @group\n\ -y = pycall('__builtin__.int(6)')\n\ - @result{} y = 6\n\ -pycall('sys.version')\n\ - @result{} ans = ...\n\ -pycall('__builtin__.eval(\"4+5\")')\n\ - @result{} ans = 9\n\ -pycall('__builtin__.dict(one=1,two=2)')\n\ - @result{} ans =\n\ - scalar structure containing the fields:\n\ - two = 2\n\ - one = 1\n\ +pycall (\"__builtin__.int\", 6)\n\ + @result{} 6\n\ +pycall (\"os.getuid\")\n\ + @result{} ...\n\ +pycall (\"__builtin__.eval\", \"4+5\")\n\ + @result{} 9\n\ @end group\n\ @end example\n\ +@seealso{pyeval, pyexec}\n\ @end deftypefn") { octave_value_list retval;
--- a/pyeval.cc Thu Apr 07 14:51:18 2016 -0700 +++ b/pyeval.cc Thu Apr 07 15:26:53 2016 -0700 @@ -39,8 +39,22 @@ DEFUN_DLD (pyeval, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} pyeval (@var{expr})\n\ -Evaluate a python expression and return result.\n\ +@deftypefn {} {} pyeval (@var{expr})\n\ +@deftypefnx {} {@var{x} =} pyeval (@var{expr})\n\ +Evaluate a Python expression and return the result.\n\ +\n\ +Examples:\n\ +@example\n\ +@group\n\ +pyeval (\"sys.version\")\n\ + @result{} ...\n\ +pyeval (\"dict(one=1, two=2)\")\n\ + @result{} scalar structure containing the fields:\n\ + two = 2\n\ + one = 1\n\ +@end group\n\ +@end example\n\ +@seealso{pycall, pyexec}\n\ @end deftypefn") { octave_value_list retval;
--- a/pyexec.cc Thu Apr 07 14:51:18 2016 -0700 +++ b/pyexec.cc Thu Apr 07 15:26:53 2016 -0700 @@ -39,8 +39,17 @@ DEFUN_DLD (pyexec, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} pyexec (@var{func})\n\ -Execute some python code.\n\ +@deftypefn {} {} pyexec (@var{expr})\n\ +Execute a Python expression or block of code.\n\ +\n\ +Examples:\n\ +@example\n\ +@group\n\ +pyexec (\"print(42)\")\n\ + @print{} 42\n\ +@end group\n\ +@end example\n\ +@seealso{pycall, pyeval}\n\ @end deftypefn") { octave_value_list retval;