U
    õÕ/eÖ  ã                   @  sR   d Z ddlmZ ddlZe e¡ZddlmZ ddl	m
Z
 dZG dd	„ d	eƒZdS )
z½ Provide the ``Alias`` class, for aliasing other properties.

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

é    )ÚannotationsNé   )ÚProperty)ÚAliasPropertyDescriptor)ÚAliasc                   @  sN   e Zd ZU dZded< ded< dZdZdZddœddd	d
œdd„Zdd„ Z	dS )r   a{  
    Alias another property of a model.

    Example:

        Consider the following class definitions:

        .. code-block:: python

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

            class Parent(Model):
                width = Int()

            class Child(Parent):
                plot_width = Alias("width")

    ÚstrÚnamez
str | NoneÚhelpFN)r	   ÚNone)Úaliased_namer	   Úreturnc                C  s   || _ || _d S )N)r   r	   )Úselfr   r	   © r   ú=/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/property/alias.pyÚ__init__H   s    zAlias.__init__c                 C  s   t || j| ƒgS )aÌ   Return a list of ``AliasPropertyDescriptor`` instances to
        install on a class, in order to delegate attribute access to this
        property.

        Args:
            aliased_name (str) : the name of the property this alias is for

        Returns:
            list[AliasPropertyDescriptor]

        The descriptors returned are collected by the ``MetaHasProps``
        metaclass and added to ``HasProps`` subclasses during class creation.
        )r   r   )r   Ú	base_namer   r   r   Úmake_descriptorsL   s    zAlias.make_descriptors)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__ÚreadonlyZ
serializedÚ_defaultr   r   r   r   r   r   r   +   s   
r   )r   Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogÚbasesr   Zdescriptorsr   Ú__all__r   r   r   r   r   Ú<module>   s   
