o
    (]^4  ã                   @   sj   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G dd	„ d	ee ƒZd
ee fdd„ZdS )é    )ÚOptionalÚSized)ÚBaseMatcher)ÚDescription)ÚMatcherz
Chris RosezCopyright 2012 hamcrest.orgzBSD, see License.txtc                   @   s:   e Zd Zd
dedee defdd„Zdeddfdd	„ZdS )ÚIsEmptyNÚitemÚmismatch_descriptionÚreturnc                 C   s^   zt |ƒdkr
W dS |r| dt |ƒ ¡ W dS W dS  ty.   |r+| d¡ Y dS Y dS w )Nr   Tzhas %d item(s)zdoes not support lengthF)ÚlenÚappend_textÚ	TypeError)Úselfr   r	   © r   úF/usr/lib/python3/dist-packages/hamcrest/library/collection/is_empty.pyÚmatches   s   ùüýüzIsEmpty.matchesÚdescriptionc                 C   s   |  d¡ d S )Nzan empty collection)r   )r   r   r   r   r   Údescribe_to   s   zIsEmpty.describe_to)N)	Ú__name__Ú
__module__Ú__qualname__r   r   r   Úboolr   r   r   r   r   r   r      s    r   r
   c                   C   s   t ƒ S )zy
    This matcher matches any collection-like object that responds to the
    __len__ method, and has a length of 0.
    )r   r   r   r   r   Úempty   s   r   N)Útypingr   r   Úhamcrest.core.base_matcherr   Úhamcrest.core.descriptionr   Úhamcrest.core.matcherr   Ú
__author__Ú__copyright__Ú__license__r   r   r   r   r   r   Ú<module>   s    