File: //usr/lib/python3/dist-packages/zope/interface/__pycache__/verify.cpython-38.pyc
U
ؒ�]! � @ s| d Z ddlmZmZ ddlmZ ddlmZmZ ddlm Z m
Z
mZ ddlZefZ
ddd�Zdd d
�Zddd�Zd
d� ZdS )z!Verify interface implementations
� )�BrokenImplementation�DoesNotImplement)�BrokenMethodImplementation)�FunctionType�
MethodType)�
fromMethod�fromFunction�MethodNc
C s` |dkr| j }n| j}|s*||�s*t| ��| �d�D �]$\}}zt||�}W n4 tk
r� t|t�sr|dkrrY q4t| |��Y nX t|t�s�q4t|t �r�t
jd dkr�t|t�r�|dkr�t
|| |dd�}nt
|| |d�}nXt|t��rt|j�t k�rt|| |�}n.t|t��r|dk�rq4nt|�s4t|d��q4|�� }|�� }t||�} | r4t|| ��q4dS ) a� Verify that 'candidate' might correctly implements 'iface'.
This involves:
o Making sure the candidate defines all the necessary methods
o Making sure the methods have the correct signature
o Making sure the candidate asserts that it implements the interface
Note that this isn't the same as verifying that the class does
implement the interface.
If optional tentative is true, suppress the "is implemented by" test.
�c� r � )�nameZimlevel)r
zNot a methodT)Z
implementedByZ
providedByr ZnamesAndDescriptions�getattr�AttributeError�
isinstancer r r �sys�version_info�typer �MethodTypes�__func__r �property�callabler ZgetSignatureInfo� _incompat)
�iface� candidate� tentative�vtypeZtesterr
Zdesc�attr�methZmess� r �7/usr/lib/python3/dist-packages/zope/interface/verify.py�_verify sF
��
r! c C s t | ||dd�S )Nr
�r �r! �r r r r r r �verifyClassh s r% c C s t | ||dd�S )N�or"