U
    õÕ/eÃ	  ã                   @  sF   d Z ddlmZ ddlZe e¡ZddlmZ dZ	G dd„ deƒZ
dS )	z Provide the Auto property.

é    )ÚannotationsNé   )ÚEnum)ÚAutoc                      s4   e Zd ZdZddœ‡ fdd„Zddœdd„Z‡  ZS )	r   aT   Accepts only the string "auto".

    Useful for properties that can be configured to behave "automatically".

    Example:

        This property is often most useful in conjunction with the
        :class:`~bokeh.core.properties.Either` property.

        .. code-block:: python

            >>> class AutoModel(HasProps):
            ...     prop = Either(Float, Auto)
            ...

            >>> m = AutoModel()

            >>> m.prop = 10.2

            >>> m.prop = "auto"

            >>> m.prop = "foo"      # ValueError !!

            >>> m.prop = [1, 2, 3]  # ValueError !!

    ÚNone)Úreturnc                   s   t ƒ  d¡ d S )NÚauto)ÚsuperÚ__init__©Úself©Ú	__class__© ú</tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/property/auto.pyr
   A   s    zAuto.__init__Ústrc                 C  s   | j jS )N)r   Ú__name__r   r   r   r   Ú__str__D   s    zAuto.__str__)r   Ú
__module__Ú__qualname__Ú__doc__r
   r   Ú__classcell__r   r   r   r   r   &   s   r   )r   Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogÚenumr   Ú__all__r   r   r   r   r   Ú<module>   s   
