pythonFunction {RSPython} | R Documentation |
This returns information describing a Python method or function within a Python module. It gives reflectance information allowing one to determine the number and types of arguments, which are keywords, and what the default values are, if any. Additionally, this returns the documentation string of the object.
pythonFunction(obj, module=NULL)
obj |
the name of the function or method being queried |
module |
the name of the module in which the function/method is to be found. This can be a character vector of one or more names identifying the module. |
An object of classes
Function
and PythonReference
.
It contains
name |
Description of `comp1' |
code |
a description of the function definition (i.e. ``signature'' and body) giving the names of the arguments and giving a count of how many local and external values |
defaults |
a list of the default values of the different arguments. This is a named list whose names correspond to the argument names. |
doc |
the documentation string associated with the Python function/method |
Duncan Temple Lang
http://www.omegahat.org/RSPython, http://www.python.org
pythonFunction("call", module="RS") els <- pythonModuleTypes("RS") RS.functionNames <- names(els[els == "function"]) RS.functionDescriptions <- lapply(RS.functionNames, function(x) pythonFunction(x, module="RS")) names(RS.functionDescriptions) <- RS.functionNames # Just get the documentation string. RS.docs <- lapply(RS.functionNames, function(x) pythonFunction(x, module="RS")[["doc"]]) names(RS.docs) <- RS.functionNames