HOME


Mini Shell 1.0
DIR: /lib/python3/dist-packages/hamcrest/library/object/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/hamcrest/library/object/__pycache__/haslength.cpython-312.pyc
�

���eq���ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dZd	Zd
ZGd�dee�Zd
eee
efde
efd�Zy)�)�Sized)�Union)�BaseMatcher)�Description)�	hasmethod)�wrap_matcher)�MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc�b��eZdZdeeddfd�Zdedefd�Zdede	ddf�fd�Z
d	e	ddfd
�Z�xZS)�	HasLength�len_matcher�returnNc��||_y)N)r)�selfrs  �C/usr/lib/python3/dist-packages/hamcrest/library/object/haslength.py�__init__zHasLength.__init__s
��&����itemc�d�t|d�sy|jjt|��S)N�__len__F)rr�matches�len)rrs  r�_matcheszHasLength._matchess*����y�)�����'�'��D�	�2�2r�mismatch_descriptionc���tt|�||�t|d�r*|j	d�jt
|��yy)Nrz with length of )�superr�describe_mismatchr�append_text�append_description_ofr)rrr�	__class__s   �rrzHasLength.describe_mismatchsE���
�i��0��7K�L��T�9�%� �,�,�-?�@�V�V�WZ�[_�W`�a�&r�descriptionc�X�|jd�j|j�y)Nzan object with length of )rrr)rr s  r�describe_tozHasLength.describe_tos#����� ;�<�R�R�SW�Sc�Sc�dr)
�__name__�
__module__�__qualname__r	�intrr�boolrrrr"�
__classcell__)rs@rrrsb���'�G�C�L�'�T�'�3�U�3�t�3�
b�e�b�;�b�SW�b�
e�{�e�t�err�matchr
c�*�tt|��S)aMMatches if ``len(item)`` satisfies a given matcher.

    :param match: The matcher to satisfy, or an expected value for
        :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

    This matcher invokes the :py:func:`len` function on the evaluated object to
    get its length, passing the result to a given matcher for evaluation.

    If the ``match`` argument is not a matcher, it is implicitly wrapped in an
    :py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
    :equality.

    Examples::

        has_length(greater_than(6))
        has_length(5)

    )rr)r)s r�
has_lengthr+!s��&�\�%�(�)�)rN)�collections.abcr�typingr�hamcrest.core.base_matcherr�hamcrest.core.descriptionr�hamcrest.core.helpers.hasmethodr�"hamcrest.core.helpers.wrap_matcherr�hamcrest.core.matcherr	�
__author__�
__copyright__�__license__rr&r+�rr�<module>r7sa��!��2�1�5�;�)�
�
�-�
�$��e��E�"�e�$*�e�C����-�.�*�7�5�>�*r