Applies the Python function isinstance()
to object
. NOTE: this function should be used to test inheritance on the Python side,
even if there are proxy classes for everything involved. It is not true (with the present version of the package) that inheritance in Python
corresponds to inheritance in R for the proxy classes.
isinstance(object, type, .ev = RPython())
Any object. The function returns FALSE
without further testing if the object is not a proxy object.
A character string corresponding to the Python type (not to the name of a proxy class for the type).
A Python error will result
if there is no such type, or if object
is a proxy from another language.
The implementation diverges from a direct mapping into the Python isinstance
to handle a Python bizarre for functions: although type(f)
causes you to think functions have the obvious type, that doesn't work in isinstance
. So the R code uses what works for this case.
(Before we get too sarcastic, the problem is similar to that in R from primitives, making class(f)
and typeof(f)
confusing.)
an XRPython evaluator, by default and usually the current evaluator.