[[.PythonReference {RSPython}R Documentation

Get an element in a Python object

Description

This gets a field or slot in the Python object identified by the PythonReference.

Usage

"[[.PythonReference"(x, i, ..., .convert=T)

Arguments

x the PythonReference object in which to find the field named name.
i a character vector specifiying the name of the field to retrieve.
... ignored, but present for compatability with the generic.
.convert a logical value indicating whether to attempt to convert the resulting Python object to R (TRUE) or leave as a reference (FALSE)

Value

The value of the Python field named name in the specified object, converted to an R object or exported to R as a reference to the Python object.

Note

One can get the names of the different fields that are accessible in a Python reference x using the command x[["__dict__", .convert=F]]$keys()

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/RSPython, http://www.python.org

See Also

$.PythonReference

Examples

## Not run: 
  p <- .PythonNew("SDefsParser", "foo.defs", .module="Sgenerate")
  p[["functions"]]

  p[["__dict__", .convert=F]]$keys()
## End(Not run)

[Package RSPython Index]