HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/mercurial/thirdparty/zope/interface/__pycache__/verify.cpython-310.pyc
o

�]LbP�@s�dZddlmZddlmZmZddlmZddlmZm	Z	ddl
mZmZm
Z
ddlZe	fZdd	d
�Zddd�Zdd
d�Zdd�ZdS)z!Verify interface implementations
�)�absolute_import�)�BrokenImplementation�DoesNotImplement)�BrokenMethodImplementation)�FunctionType�
MethodType)�
fromMethod�fromFunction�MethodNc
	CsF|dkr|j}n|j}|s||�st|��|�d�D]�\}}zt||�}Wnty<t|t�s7|dkr7Yqt||��wt|t�sCqt|t	�ret
jddkr]t|t�r]t
|||dd�}n/t
|||d�}n't|t�rxt|j�t	urxt|||�}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.
    �crr�)�name�imlevel)rzNot a methodT)�
implementedBy�
providedByr�namesAndDescriptions�getattr�AttributeError�
isinstancerrr�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�_verifysH
�

�



�r*cC�t|||dd�S)Nr�r"�r*�rr r!r(r(r)�verifyClassg�r/cCr+)N�or,r-r.r(r(r)�verifyObjectjr0r2cCspt|d�t|d�krdSt|d�t|d�kr |ds dS|dr*|ds*dS|dr4|ds6dSdSdS)	N�requiredz*implementation requires too many arguments�
positional�varargsz-implementation doesn't allow enough arguments�kwargsz0implementation doesn't support keyword argumentsz1implementation doesn't support variable arguments)�len)r3�implementedr(r(r)rms��r)rN)r)�__doc__�
__future__r�
exceptionsrrr�typesrr�	interfacer	r
rrrr*r/r2rr(r(r(r)�<module>s


J