Learn R Programming

reticulate (version 1.38.0)

nameOfClass.python.builtin.type: nameOfClass() for Python objects

Description

This generic enables passing a python.builtin.type object as the 2nd argument to base::inherits().

Usage

# S3 method for python.builtin.type
nameOfClass(x)

Value

A scalar string matching the S3 class of objects constructed from the type.

Arguments

x

A Python class

Examples

Run this code
if (FALSE) {
  numpy <- import("numpy")
  x <- r_to_py(array(1:3))
  inherits(x, numpy$ndarray)
}

Run the code above in your browser using DataLab