class_docstr: Accept values according to a sequence of other property types.
  
  Example:
  
      .. code-block:: python
  
          >>> class EitherModel(HasProps):
          ...     prop = Either(Bool, Int, Auto)
          ...
  
          >>> m = EitherModel()
  
          >>> m.prop = True
  
          >>> m.prop = 10
  
          >>> m.prop = "auto"
  
          >>> m.prop = 10.3   # ValueError !!
  
          >>> m.prop = "foo"  # ValueError !!
class_docstr_tok: ["Accept","values","according","to","a","sequence","of","other","property","types",".","Example",":","..","code-block",":",":","python",">",">",">","class","EitherModel","(","HasProps",")",":","...","prop","=","Either","(","Bool",",","Int",",","Auto",")","...",">",">",">","m","=","EitherModel","(",")",">",">",">","m.prop","=","True",">",">",">","m.prop","=","10",">",">",">","m.prop","=","``","auto","''",">",">",">","m.prop","=","10.3","#","ValueError","!","!",">",">",">","m.prop","=","``","foo","''","#","ValueError","!","!"]
code: def replace(
      self, old: type[Property[Any]], new: Property[Any]
  ) -> Property[Any]:
      if self.__class__ == old:
          return new
      else:
          params = [
              type_param.replace(old, new)
              for type_param in self.type_params
          ]
          return Either(*params)
  
file_path: bokeh/src/bokeh/core/property/either.py
imports: from __future__ import annotations
  import logging
  from typing import Any, TypeVar
  from ...util.strings import nice_join
  from ._sphinx import property_link, register_type_link, type_link
  from .bases import Init, ParameterizedProperty, Property, TypeOrInst
  from .singletons import Intrinsic
label_desc: Use image node_id 5 for calling the Either obj's underlying member method code with example usage: obj.replace(old, new) and returns: new, Either