File: //lib64/python2.7/site-packages/mercurial/thirdparty/attr/validators.pyc
�
1�3\c @` sE d Z d d l m Z m Z m Z d d l m Z m Z m Z m Z d d d d d g Z
e d
e d e d e � d
e
f d � � Y� Z d � Z e d
e d e d e � d e
f d � � Y� Z d � Z e d
e d e d e � d e
f d � � Y� Z d � Z e d
e d e d e � d e
f d � � Y� Z d � Z d S( s
Commonly useful validators.
i ( t absolute_importt divisiont print_functioni ( t attrt
attributest and_t
_AndValidatorR t in_t instance_oft optionalt providest reprt slotst hasht _InstanceOfValidatorc B` s# e Z e � Z d � Z d � Z RS( c
C` sX t | | j � sT t d j d | j d | j d | j d | � | | j | � � n d S( sP
We use a callable class to be able to change the ``__repr__``.
s? '{name}' must be {type!r} (got {value!r} that is a {actual!r}).t namet typet actualt valueN( t
isinstanceR t TypeErrort formatR t __class__( t selft instR R ( ( sJ /usr/lib64/python2.7/site-packages/mercurial/thirdparty/attr/validators.pyt __call__ s c C` s d j d | j � S( Ns) <instance_of validator for type {type!r}>R ( R R ( R ( ( sJ /usr/lib64/python2.7/site-packages/mercurial/thirdparty/attr/validators.pyt __repr__$ s ( t __name__t
__module__R R R R ( ( ( sJ /usr/lib64/python2.7/site-packages/mercurial/thirdparty/attr/validators.pyR s
c C` s
t | � S( s�
A validator that raises a :exc:`TypeError` if the initializer is called
with a wrong type for this particular attribute (checks are perfomed using
:func:`isinstance` therefore it's also valid to pass a tuple of types).
:param type: The type to check for.
:type type: type or tuple of types
:raises TypeError: With a human readable error message, the attribute
(of type :class:`attr.Attribute`), the expected type, and the value it
got.
( R ( R ( ( sJ /usr/lib64/python2.7/site-packages/mercurial/thirdparty/attr/validators.pyR + s
t _ProvidesValidatorc B` s# e Z e � Z d � Z d � Z RS( c C` sO | j j | � sK t d j d | j d | j d | � | | j | � � n d S( sP
We use a callable class to be able to change the ``__repr__``.
s<