File: //lib/python3/dist-packages/hamcrest/core/core/__pycache__/isinstanceof.cpython-310.pyc
o
(]^� � @ sv d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z dZ
dZdZG d d
� d
ee
�Zdede e
fd
d�ZdS )� )�Type)�BaseMatcher)�Description)�is_matchable_type)�MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc @ sB e Zd Zdeddfdd�Zdedefdd�Zd eddfd
d�Z dS )�IsInstanceOf�
expected_type�returnNc C s t |�std��|| _d S )NzIsInstanceOf requires type)r � TypeErrorr )�selfr � r �A/usr/lib/python3/dist-packages/hamcrest/core/core/isinstanceof.py�__init__ s
zIsInstanceOf.__init__�itemc C s t || j�S )N)�
isinstancer )r r r r r
�_matches s zIsInstanceOf._matches�descriptionc C s |� d�� | jj� d S )Nzan instance of )�append_textr �__name__)r r r r r
�describe_to s zIsInstanceOf.describe_to)
r �
__module__�__qualname__r r �object�boolr r r r r r r
r
s r �atyper c C s t | �S )aH Matches if object is an instance of, or inherits from, a given type.
:param atype: The type to compare against as the expected type.
This matcher checks whether the evaluated object is an instance of
``atype`` or an instance of any class that inherits from ``atype``.
Example::
instance_of(str)
)r )r r r r
�instance_of s
r N)�typingr �hamcrest.core.base_matcherr �hamcrest.core.descriptionr �"hamcrest.core.helpers.wrap_matcherr �hamcrest.core.matcherr �
__author__�
__copyright__�__license__r r r r r r r
�<module> s