Interaction between `param.rx` and `isinstance`
Is your feature request related to a problem? Please describe.
I couldn't find an relevant information on how to do an isinstance check of the inner object of the param.rx. Right now I have:
if isinstance(field, param.rx):
if field.rx.pipe(isinstance, xarray.DataArray):
curr_data = field
This could work, but feels a bit clunky. It would be much nicer if isinstance could work without having to check if it's a param.rx and then use pipe, e.g. by creating a dynamic class that inherits the type of the first definition, or any other way to override isinstance checks.
Describe alternatives you've considered
I have of course tried if it already works, but it doesn't seem to
import param
a = param.rx("string")
isinstance(a, str)
but this doesn't work
Good question! Would you be happy with a.rx.isinstance(str)? I think that would be the natural approach here, though we'd need to add that method.
As a clutch, it does help. The preferred interface would be to not have to check for isinstance(_, param.rx). Unfortunately the only method that I know would work is like attrs, but it is quite a redactor for that.
I'm still getting a hang of the .rx interface. I guess neither approach will work with if.
I'd prefer if isinstance resolved to the underlying value.