Is there a way to allow using subclasses with ClassSelector?

    layout = param.ClassSelector(default=Column, class_=ListLike, doc="""
        The layout of the widgets.""")

Since Column is a ListLike subclass, I expected this to work, but I get:


ValueError: ClassSelector parameter 'layout' value must be an instance of ListLike, not <class 'panel.layout.base.Column'>.
1 Like

From the docs: Parameter types — param v2.0.1

A ClassSelector has a value that is either an instance or a subclass of a specified Python class_. By default, requires an instance of that class, but specifying is_instance=False means that a subclass must be selected instead.

So:

    layout = param.ClassSelector(default=Column, class_=ListLike, is_instance=False, doc="""
        The layout of the widgets.""")
1 Like