+
    -i)                         ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 . t
 ! R R	4      t ! R
 R]4      tR t]! 4       tR# )    N)FunctionType)	Interface)classImplements)InterfaceClass)_decorator_non_return)fromFunctionc                   &   a  ] tR t^ t o R tRtV tR# )optionalc                (    VP                   V n         R # N__doc__)selfmethods   &&@/usr/lib/python3/dist-packages/zope/interface/common/__init__.py__init__optional.__init__$   s    ~~    r   N)__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r   r
   r
       s     & &r   r
   c                   |   a  ] tR t^(t o RtR t]R 4       tR t]R 4       t	]R 4       t
R tRR	 ltR
 tR tRtV tR# )ABCInterfaceClassa 
  
An interface that is automatically derived from a
:class:`abc.ABCMeta` type.

Internal use only.

The body of the interface definition *must* define
a property ``abc`` that is the ABC to base the interface on.

If ``abc`` is *not* in the interface definition, a regular
interface will be defined instead (but ``extra_classes`` is still
respected).

Use the ``@optional`` decorator on method definitions if
the ABC defines methods that are not actually required in all cases
because the Python language has multiple ways to implement a protocol.
For example, the ``iter()`` protocol can be implemented with
``__iter__`` or the pair ``__len__`` and ``__getitem__``.

When created, any existing classes that are registered to conform
to the ABC are declared to implement this interface. This is *not*
automatically updated as the ABC registry changes. If the body of the
interface definition defines ``extra_classes``, it should be a
tuple giving additional classes to declare implement the interface.

Note that this is not fully symmetric. For example, it is usually
the case that a subclass relationship carries the interface
declarations over::

    >>> from zope.interface import Interface
    >>> class I1(Interface):
    ...     pass
    ...
    >>> from zope.interface import implementer
    >>> @implementer(I1)
    ... class Root(object):
    ...     pass
    ...
    >>> class Child(Root):
    ...     pass
    ...
    >>> child = Child()
    >>> isinstance(child, Root)
    True
    >>> from zope.interface import providedBy
    >>> list(providedBy(child))
    [<InterfaceClass __main__.I1>]

However, that's not the case with ABCs and ABC interfaces. Just
because ``isinstance(A(), AnABC)`` and ``isinstance(B(), AnABC)``
are both true, that doesn't mean there's any class hierarchy
relationship between ``A`` and ``B``, or between either of them
and ``AnABC``. Thus, if ``AnABC`` implemented ``IAnABC``, it would
not follow that either ``A`` or ``B`` implements ``IAnABC`` (nor
their instances provide it)::

    >>> class SizedClass(object):
    ...     def __len__(self): return 1
    ...
    >>> from collections.abc import Sized
    >>> isinstance(SizedClass(), Sized)
    True
    >>> from zope.interface import classImplements
    >>> classImplements(Sized, I1)
    None
    >>> list(providedBy(SizedClass()))
    []

Thus, to avoid conflicting assumptions, ABCs should not be
declared to implement their parallel ABC interface. Only concrete
classes specifically registered with the ABC should be declared to
do so.

.. versionadded:: 5.0.0
c           	     8   Wn         VP                  R R4      pVP                  RR4      pRV9  d;   \        P                  ! WW#4       \        P                  WV4       \        V n        R# VP                  R4      pW`n        \        V4      V n	        \        V4      V n
        VR,          VP                   8X  g	   Q W34       h\        V4      P                  4        UUu/ uF`  w  rx\        V\        4      '       g   K  V P                  V4      '       d   K6  V P!                  V4      '       d   KO  WpP#                  W4      bKb  	  p	ppV P%                  V4      V	R&   V	P'                  V4       \        P                  ! WW)4       V P                  4        R# u uppi )extra_classesignored_classesabcN   NNr    )r   popr   r   r   $_ABCInterfaceClass__register_classes	__class___ABCInterfaceClass__abctuple!_ABCInterfaceClass__extra_classes#_ABCInterfaceClass__ignored_classesvarsitems
isinstancer   #_ABCInterfaceClass__is_private_name,_ABCInterfaceClass__is_reverse_protocol_name(_ABCInterfaceClass__method_from_function$_ABCInterfaceClass__create_class_docupdate)
r   namebasesattrsr    r!   based_onkvmethodss
   &&&&      r   r   ABCInterfaceClass.__init__z   si   		/26))$5r: ##D=00_ ,DN99U#
$]3!&!7Bx8,,,>t.>>,
 X,,.	
 /!\* 1 &&q) 1 //2	 1A**100.	 	 
 "44U;	uE;!
s   F>FF0Fc                   V P                  4        UUu/ uF  w  r\        V\        4      '       g   K  WbK!  	  pppV F  p\        W&   K  	  V'       g   R # RRP	                  R VP                  4        4       4      ,           pV# u uppi ) z)

The following methods are optional:
 - z
-c              3   H   "   T F  w  rV R VP                    2x  K  	  R# 5i)
Nr   ).0r9   r:   s   &  r   	<genexpr>?ABCInterfaceClass.__optional_methods_to_docs.<locals>.<genexpr>   s&      K
,=DAqcAII;,=s    ")r.   r/   r
   r   join)r7   r9   r:   	optionalsdocss   &    r   __optional_methods_to_docs,ABCInterfaceClass.__optional_methods_to_docs   s}    &+kkmOmdaz!X7NTQTm	OA,EH  =

 K
,5OO,=K
 A
 
  Ps
   BBc                  a V P                   pR  oRP                  V3R l\        V P                  4       SR7       4       4      pV'       d
   RV,           pVP                  ;'       g    RpVP                  4       pV'       d
   V^ ,          MRpRP                  VP                  VP                  VP                  RV4      V P                  V4      V4      pV# )c                     V P                   pV P                  pV\        P                   8X  d
   R V,          # VR8X  d   RpRV RV R2# )z`%s`_ioio`.)r   r   str)cmodr5   s   &  r   ref1ABCInterfaceClass.__create_class_doc.<locals>.ref   sK    ,,C::Dcnn$}$e|se1TF!$$r   z
 - c              3   4   <"   T F  pS! V4      x  K  	  R # 5ir   r%   )rA   rP   rR   s   & r   rB   7ABCInterfaceClass.__create_class_doc.<locals>.<genexpr>   s      +
D FFDs   )keyz!

Known implementations are:

 - r>   z&Interface for the ABC `{}.{}`.

{}{}{}r   )r)   rD   sortedgetRegisteredConformersr   
splitlinesformatr   r   get,_ABCInterfaceClass__optional_methods_to_docs)r   r7   r8   implementations_docbased_on_docdocrR   s   &&    @r   __create_class_doc$ABCInterfaceClass.__create_class_doc   s    ::	% &ll +
D88:D+
 
 7:MM   !((..B#..0*6|AB<CC!2!2IIi.++E2	
 
r   c                    V P                  R 4      '       d   V P                  R 4      '       d   R# V P                  R4      # )__F_
startswithendswithr5   s   &r   __is_private_name#ABCInterfaceClass.__is_private_name   s1    ??4  T]]4%8%8s##r   c                V    V P                  R 4      ;'       d    V P                  R4      # )__rrc   re   rh   s   &r   __is_reverse_protocol_name,ABCInterfaceClass.__is_reverse_protocol_name   s$     u%==$--*==r   c                P    \        WVR 7      pVP                  R,          Vn        V# )rh   r#   )r   
positional)r   functionr5   r   s   &&& r   __method_from_function(ABCInterfaceClass.__method_from_function   s(    h48 #--b1r   Nc                    Ve   TMV P                  4       pVe   TMV P                  pV F  pWC9   d   K  \        W@4       K  	  R # r   )rX   r,   r   )r   
conformersr!   ignoredclss   &&&  r   __register_classes$ABCInterfaceClass.__register_classes   sQ     %0J--/ 	
  /:O'' 	 C~C& r   c                    V P                   # )z+
Return the ABC this interface represents.
)r)   )r   s   &r   getABCABCInterfaceClass.getABC   s     zzr   c                   V P                   p \        VP                  4      \        VP                  4      ,           p\        \        P                  ! W P                  4      4      #   \         do    ^ RIHp T! T4      pT^ ,          pT^,          p\        P                  ! YV4       Uu. uF	  qw! 4       NK  	  Mu upi ppT Uu. uF
  qwf   K  TNK  	  Mu upi pp Li ; i)zb
Return an iterable of the classes that are known to conform to
the ABC this interface parallels.
)	_get_dump)r)   list_abc_registry
_abc_cacheAttributeErrorr"   r~   	itertoolschainsetr+   )r   r8   
registeredr~   dataregistrycachexs   &       r   rX   )ABCInterfaceClass.getRegisteredConformers   s    
 ::	BX++,tH4G4G/HH  9??:/C/CDEE  	B &X&DAwHGE'0x'GH'G!!#'GHJH%/AZ!!ZAJAJ	Bs0   /A& &AC)B98CCCCC)__abcr(   __extra_classes__ignored_classesr   )NN)r   r   r   r   r   r   staticmethodr\   r3   r0   r1   r2   r'   r{   rX   r   r   r   s   @r   r   r   (   so     Jb$"L  B $ $
 > >' F Fr   r   c                      R \         3/ 3p \        P                  ! \        .V O5!  p\        P                  ! V.V O5!   V# )ABCInterface)r   r   __new__r   r   )abc_name_bases_attrsinstances     r   _create_ABCInterfacer     sI    
 +YL"= ((0H H<';<Or   )r   typesr   zope.interfacer   r   zope.interface.interfacer   r   r   __all__r
   r   r   r   r%   r   r   <module>r      sM      $ * 3 : 1& &kF kF\
 $%r   