o
    (]^×  ã                   @   s`   d dl mZmZ d dlmZ d dlmZ d dlmZ dZ	dZ
dZedƒZG d	d
„ d
ee ƒZdS )é    )ÚOptionalÚTypeVar)ÚDescription)ÚMatcher©ÚtostringzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtÚTc                   @   sx   e Zd ZdZdefdd„Zdedefdd„Zdded	e	e
 defd
d„Zded	e
ddfdd„Zdede
ddfdd„ZdS )ÚBaseMatcheraŠ  Base class for all :py:class:`~hamcrest.core.matcher.Matcher`
    implementations.

    Most implementations can just implement :py:obj:`_matches`, leaving the
    handling of any mismatch description to the ``matches`` method. But if it
    makes more sense to generate the mismatch description during the matching,
    override :py:meth:`~hamcrest.core.matcher.Matcher.matches` instead.

    Úreturnc                 C   s   t | ƒS ©Nr   )Úself© r   ú</usr/lib/python3/dist-packages/hamcrest/core/base_matcher.pyÚ__str__   ó   zBaseMatcher.__str__Úitemc                 C   s   t dƒ‚)NÚ_matches)ÚNotImplementedError)r   r   r   r   r   r      r   zBaseMatcher._matchesNÚmismatch_descriptionc                 C   s"   |   |¡}|s|r|  ||¡ |S r   )r   Údescribe_mismatch)r   r   r   Úmatch_resultr   r   r   Úmatches   s   
zBaseMatcher.matchesc                 C   ó   |  d¡ |¡ d S ©Nzwas ©Úappend_textÚappend_description_of)r   r   r   r   r   r   r   %   ó   zBaseMatcher.describe_mismatchÚmatch_descriptionc                 C   r   r   r   )r   r   r   r   r   r   Údescribe_match(   r   zBaseMatcher.describe_matchr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   r   Úboolr   r   r   r   r   r   r   r   r   r   r	      s    
r	   N)Útypingr   r   Úhamcrest.core.descriptionr   Úhamcrest.core.matcherr   Ú hamcrest.core.string_descriptionr   Ú
__author__Ú__copyright__Ú__license__r   r	   r   r   r   r   Ú<module>   s    