
    f                     f    d dl mZmZ d dl mZ d dlmZ d dlmZmZ d dl	m
Z
 ddZddZdd	Zd
 Zy)    )BrokenImplementationDoesNotImplement)BrokenMethodImplementation)FunctionType)
fromMethodfromFunction)MethodTypesNc                    |du r| j                   }n| j                  }|s ||      st        |       | j                  d      D ]  \  }}t	        ||      st        | |      t        ||      }t        |      t        u rt        ||      }nt        |      t        v rt        ||      }ng|j                         }|j                         }t        ||      }	|	st        ||	       y)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   )isImplementedByInstancesOfisImplementedByr   namesAndDescriptionshasattrr   getattrtyper   r   r	   r   getSignatureInfo	_incompatr   )
iface	candidate	tentativevtypetesterndattrmethmesss
             h/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/Interface/Verify.py_verifyr       s    $ |11&&VY0u%%**1- 61y!$&ua00y!$:%a(D$Z;&dA&D



$$&D!,Q55%6(     c                      t        | ||d      S )Nr   r   r    r   r   r   s      r   verifyClassr&   E       5)Yc::r!   c                      t        | ||d      S )Nor#   r$   r%   s      r   verifyObjectr*   H   r'   r!   c                     t        |d         t        | d         kD  ryt        |d         t        | d         k  r|d   sy| d   r|d   sy| d   r|d   syy y )	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)r,   implementeds     r   r   r   K   sv    
 ;z"#c(:*>&??;	[&	'#h|.D*E	EI&>+h"7A	;y#9B $:r!   )r   N)r   )
Exceptionsr   r   r   typesr   Methodr   r   _objectr	   r    r&   r*   r    r!   r   <module>r7      s,    > 1  + .`;;Cr!   