File: //lib/python3/dist-packages/mercurial/thirdparty/zope/interface/__pycache__/verify.cpython-310.pyc
o
�]LbP � @ s� d Z ddlmZ ddlmZmZ ddlmZ ddlmZm Z ddl
mZmZm
Z
ddlZe fZdd d
�Zddd�Zdd
d�Zdd� ZdS )z!Verify interface implementations
� )�absolute_import� )�BrokenImplementation�DoesNotImplement)�BrokenMethodImplementation)�FunctionType�
MethodType)�
fromMethod�fromFunction�MethodNc
C sF |dkr| j }n| j}|s||�st| ��| �d�D ]�\}}zt||�}W n ty< t|t�s7|dkr7Y qt| |��w t|t�sCqt|t �ret
jd dkr]t|t�r]t
|| |dd�}n/t
|| |d�}n't|t�rxt|j�t u rxt|| |�}nt|t�r�|dkr�qt|�s�t|d��q|�� }|�� }t||�} | r�t|| ��qdS ) 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.
�cr r � )�name�imlevel)r zNot a methodT)�
implementedBy�
providedByr �namesAndDescriptions�getattr�AttributeError�
isinstancer r r �sys�version_info�typer
�MethodTypes�__func__r �property�callabler �getSignatureInfo� _incompat)
�iface� candidate� tentative�vtype�testerr �desc�attr�meth�mess� r( �L/usr/lib/python3/dist-packages/mercurial/thirdparty/zope/interface/verify.py�_verify sH
�
�
�r* c C � t | ||dd�S )Nr �r"