Interaction between `param.rx` and `isinstance`
- Dominant language
- Python
- Stars
- 521
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 35
Description
#### 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:
```python
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
```python
import param
a = param.rx("string")
isinstance(a, str)
```
but this doesn't work
Contributor guide
Assessment
This issue has not been assessed yet.