U
    õÕ/e‚  ã                   @  sV   d Z ddlmZ ddlZe e¡ZddlmZm	Z	 dZ
e	dƒZG dd„ dee ƒZdS )	zÐ Provide the ``Override`` class, for overriding base class property
attributes.

.. note::
    This class should normally be imported from ``bokeh.core.properties``
    instead of directly from this module.

é    )ÚannotationsN)ÚGenericÚTypeVar)ÚOverrideÚTc                   @  s2   e Zd ZU dZded< ded< dddœdd	„Zd
S )r   a   Override attributes of Bokeh property in derived Models.

    When subclassing a Bokeh Model, it may be desirable to change some of the
    attributes of the property itself, from those on the base class. This is
    accomplished using the ``Override`` class.

    Currently, ``Override`` can only be use to override the ``default`` value
    for the property.

    Keyword Args:
        default (obj) : a default value for this property on a subclass

    Example:

        Consider the following class definitions:

        .. code-block:: python

            from bokeh.model import Model
            from bokeh.properties import Int, Override

            class Parent(Model):
                foo = Int(default=10)

            class Child(Parent):
                foo = Override(default=20)

        The parent class has an integer property ``foo`` with default value
        10.  The child class uses the following code:

        .. code-block:: python

            foo = Override(default=20)

        to specify that the default value for the ``foo`` property should be
        20 on instances of the child class:

        .. code-block:: python

            >>> p = Parent()
            >>> p.foo
            10

            >>> c = Child()
            >>> c.foo
            20

    ÚboolÚdefault_overriddenr   ÚdefaultÚNone)r	   Úreturnc                C  s   d| _ || _d S )NT)r   r	   )Úselfr	   © r   ú@/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/property/override.pyÚ__init__b   s    zOverride.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   r   r   r   -   s   
1r   )r   Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogÚtypingr   r   Ú__all__r   r   r   r   r   r   Ú<module>   s   
