HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/zope/interface/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/zope/interface/__pycache__/verify.cpython-311.pyc
�

JDvc� ���dZddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddl
mZdd	l
m
Z
dd
l
mZddl
mZddlmZmZmZd
dgZefZdd�Zd�Zdd�Zdd�Zeje_dZeef��Zd�Zd�ZdS)z!Verify interface implementations
�)�print_functionN)�FunctionType)�
MethodType)�PYPY2)�BrokenImplementation)�BrokenMethodImplementation)�DoesNotImplement)�Invalid)�MultipleInvalid)�
fromMethod�fromFunction�Method�verifyObject�verifyClassFc��|dkr|j}n|j}g}|s.||��s#|�t||����|�d���D]E\}}	t|||||���#t$r}|�|��Yd}~�>d}~wwxYw|r,t|��dkr|d�t|||���dS)a�
    Verify that *candidate* might correctly provide *iface*.

    This involves:

    - Making sure the candidate claims that it provides the
      interface using ``iface.providedBy`` (unless *tentative* is `True`,
      in which case this step is skipped). This means that the candidate's class
      declares that it `implements <zope.interface.implementer>` the interface,
      or the candidate itself declares that it `provides <zope.interface.provider>`
      the interface

    - Making sure the candidate defines all the necessary methods

    - Making sure the methods have the correct signature (to the
      extent possible)

    - Making sure the candidate defines all the necessary attributes

    :return bool: Returns a true value if everything that could be
       checked passed.
    :raises zope.interface.Invalid: If any of the previous
       conditions does not hold.

    .. versionchanged:: 5.0
        If multiple methods or attributes are invalid, all such errors
        are collected and reported. Previously, only the first error was reported.
        As a special case, if only one such error is present, it is raised
        alone, like before.
    �cT)�allN�r)	�
implementedBy�
providedBy�appendr	�namesAndDescriptions�_verify_elementr
�lenr)	�iface�	candidate�	tentative�vtype�tester�excs�name�desc�es	         �7/usr/lib/python3/dist-packages/zope/interface/verify.py�_verifyr%*s��@
��|�|��$����!��
�D��8�V�V�I�.�.�8����$�U�I�6�6�7�7�7��0�0�T�0�:�:���
��d�	��E�4��y�%�@�@�@�@���	�	�	��K�K��N�N�N�N�N�N�N�N�����	�����6��t�9�9��>�>��q�'�M��e�Y��5�5�5��4s�$A8�8
B!�B�B!c���	t||��}n=#t$r0t|t��s	|dkrYdSt	|||���wxYwt|t��sdStj|��stj|��rdSt|t��rXtj
ddkr/t|t��r|dkrt|||d���}n�t|||���}n�t|t��r-t|j��turt|||��}nAt|t ��r|dkrdSt#|��st%|d|||���dSt'|���|�����}|r-t*rt-|||��rdSt%|||||���dS)Nrr�r)r!�imlevel)r!zimplementation is not a method)�getattr�AttributeError�
isinstancerr�inspect�ismethoddescriptor�	isbuiltinr�sys�version_info�typer
�MethodTypes�__func__r�property�callabler�	_incompat�getSignatureInfor�_pypy2_false_positive)rr!r"rr�attr�meth�messs        r$rr`s,��;��y�$�'�'�����;�;�;��4��(�(�	�e�s�l�l�
�F�F�"�5�$�	�:�:�:�
;�����d�F�#�#�����!�$�'�'��7�+<�T�+B�+B��	���$��%�%����A��!�#�#�
�9�d�(C�(C�#��QT���
 ��e�$�()�+�+�+�D�D� ��e�$�7�7�7�D�D�
�T�;�
'�
'���4�=�!�!�\�1�1��$��t�,�,���	�D�(�	#�	#�
�����
	����~�~�	E�,�T�3S�-1�5�)�E�E�
E�	���T�*�*�,�,�d�.C�.C�.E�.E�F�F�D��M��	�*�4��E�B�B�	��F�(��t�T�5�)�L�L�L�M�Ms��%A
�A
c�(�t|||d���S)zF
    Verify that the *candidate* might correctly provide *iface*.
    r�r�r%�rrrs   r$rr�s���5�)�Y�c�:�:�:�:�c�(�t|||d���S)N�or=r>r?s   r$rr�s���5�)�Y�c�:�:�:�:r@z*implementation requires too many argumentsc��|tvrdStt�����}|dkr|nt	|��}||vrdSdS)NFrT)�_KNOWN_PYPY2_FALSE_POSITIVES�vars�__builtins__�valuesr1)�msgrr�known_builtin_types�candidate_types     r$r8r8�s\���.�.�.��u��|�,�,�3�3�5�5��"'�3�,�,�Y�Y�D��O�O�N��,�,�,��t��5r@c�$�t|d��t|d��krtSt|d��t|d��kr
|dsdS|dr
|dsdS|dr
|dsdSdSdS)N�required�
positional�varargsz-implementation doesn't allow enough arguments�kwargsz0implementation doesn't support keyword argumentsz1implementation doesn't support variable arguments)r�
_MSG_TOO_MANY)rL�implementeds  r$r6r6�s���
�;�z�"�#�#�c�(�:�*>�&?�&?�?�?���	�[��
&�	'�	'�#�h�|�.D�*E�*E�	E�	E��I�&�
F�>�>����B�+�h�"7�B�A�A��	��C�;�y�#9�C�B�B�C�C�C�Cr@)FN)F)�__doc__�
__future__rr,r/�typesrr�zope.interface._compatr�zope.interface.exceptionsrrr	r
r�zope.interface.interfacerr
r�__all__r2r%rrrrP�	frozensetrDr8r6�r@r$�<module>r[s�����%�%�%�%�%�%�����
�
�
�
�������������(�(�(�(�(�(�:�:�:�:�:�:�@�@�@�@�@�@�6�6�6�6�6�6�-�-�-�-�-�-�5�5�5�5�5�5�E�E�E�E�E�E�E�E�E�E������n��4�4�4�4�lAM�AM�AM�J;�;�;�;�;�;�;�;�����<�
�(�y��*� � ��
���.
C�
C�
C�
C�
Cr@