#-----------------------------------------------------------------------------# Copyright (c) Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------""" Provide ``NotSerialized`` property. """#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Standard library importsfromtypingimportAny,TypeVar# Bokeh importsfrom._sphinximportproperty_link,register_type_link,type_linkfrom.basesimport(Init,Property,SingleParameterizedProperty,TypeOrInst,)from.singletonsimportIntrinsic#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=("NotSerialized",)T=TypeVar("T")#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]classNotSerialized(SingleParameterizedProperty[T]):""" A property which state won't be synced with the browser. """_serialized=Falsedef__init__(self,type_param:TypeOrInst[Property[T]],*,default:Init[T]=Intrinsic,help:str|None=None)->None:super().__init__(type_param,default=default,help=help)
#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------@register_type_link(NotSerialized)def_sphinx_type_link(obj:SingleParameterizedProperty[Any])->str:returnf"{property_link(obj)}({type_link(obj.type_param)})"