class_docstr: A base class for Bokeh properties with simple get/set and serialization
  behavior.
class_docstr_tok: ["A","base","class","for","Bokeh","properties","with","simple","get\/set","and","serialization","behavior","."]
docstr: Implement the setter for the Python `descriptor protocol`_.
  
  .. note::
      An optional argument ``setter`` has been added to the standard
      setter arguments. When needed, this value should be provided by
      explicitly invoking ``__set__``. See below for more information.
  
  Args:
      obj (HasProps) :
          The instance to set a new property value on
  
      value (obj) :
          The new value to set the property to
  
      setter (ClientSession or ServerSession or None, optional) :
          This is used to prevent "boomerang" updates to Bokeh apps.
          (default: None)
  
          In the context of a Bokeh server application, incoming updates
          to properties will be annotated with the session that is
          doing the updating. This value is propagated through any
          subsequent change notifications that the update triggers.
          The session can compare the event setter to itself, and
          suppress any updates that originate from itself.
  
  Returns:
      None
code: def __set__(
      self, obj: HasProps, value: T, *, setter: Setter | None = None
  ) -> None:
      """Implement the setter for the Python `descriptor protocol`_.
  
      .. note::
          An optional argument ``setter`` has been added to the standard
          setter arguments. When needed, this value should be provided by
          explicitly invoking ``__set__``. See below for more information.
  
      Args:
          obj (HasProps) :
              The instance to set a new property value on
  
          value (obj) :
              The new value to set the property to
  
          setter (ClientSession or ServerSession or None, optional) :
              This is used to prevent "boomerang" updates to Bokeh apps.
              (default: None)
  
              In the context of a Bokeh server application, incoming updates
              to properties will be annotated with the session that is
              doing the updating. This value is propagated through any
              subsequent change notifications that the update triggers.
              The session can compare the event setter to itself, and
              suppress any updates that originate from itself.
  
      Returns:
          None
  
      """
      if not hasattr(obj, "_property_values"):
          # Initial values should be passed in to __init__, not set directly
          class_name = obj.__class__.__name__
          raise RuntimeError(
              f"Cannot set a property value {self.name!r} on a {class_name} instance before HasProps.__init__"
          )
  
      if self.property.readonly and obj._initialized:
          class_name = obj.__class__.__name__
          raise RuntimeError(
              f"{class_name}.{self.name} is a readonly property"
          )
  
      value = self.property.prepare_value(obj, self.name, value)
      old = self._get(obj)
      self._set(obj, old, value, setter=setter)
  
imports: from __future__ import annotations
  import logging
  from copy import copy
  from types import FunctionType
  from typing import TYPE_CHECKING, Any, Callable, Generic, TypeVar
  from ...util.deprecation import deprecated
  from .singletons import Undefined
  from .wrappers import PropertyValueColumnData, PropertyValueContainer
label_desc: Use image node_id 4 for calling the PropertyDescriptor obj's underlying member method code with example usage: obj.__set__(obj, value) without return types