
    c|                     V    d Z ddlZddlZddlmZ defdZdefdZdefdZdefdZ	dS )	a  Contains logic for retrieving special methods.

This implementation does not rely on the dot attribute access
logic, found in ``.getattr()``. The difference between these two
is that the dunder methods are looked with the type slots
(you can find more about these here
http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/)
As such, the lookup for the special methods is actually simpler than
the dot attribute access.
    N)AttributeInferenceErrorreturnc                 &   | j                             g           }t          j                            fd|                     d          D                       }t          t          j        ||                    }|st          |           |S )Nc              3   N   K   | ]}|j                             g           V   d S )N)localsget).0ancestornames     Alib/python3.11/site-packages/astroid/interpreter/dunder_lookup.py	<genexpr>z!_lookup_in_mro.<locals>.<genexpr>   sF       * **2D"%%* * * * * *    T)recurs	attributetarget)r   r   	itertoolschainfrom_iterable	ancestorslistr   )noder   attrsnodesvaluess    `   r   _lookup_in_mror      s    KOOD"%%EO)) * * * *6:nnDn6Q6Q* * *  E )/%//00F C%TBBBBMr   c                 z   t          | t          j        t          j        t          j        t          j        t          j        f          rt          | |          S t          | t          j                  rt          | |          S t          | t          j
                  rt          | |          S t          ||           )zLookup the given special method name in the given *node*.

    If the special method was found, then a list of attributes
    will be returned. Otherwise, `astroid.AttributeInferenceError`
    is going to be raised.
    r   )
isinstanceastroidListTupleConstDictSet_builtin_lookupInstancer   ClassDef_class_lookupr   )r   r   s     r   lookupr)   "   s     w|W]GM7<U  + tT***$()) *dD)))$()) )T4(((
!D
>
>
>>r   c                 p    |                                  }|t          ||           t          ||          S Nr   )	metaclassr   r   )r   r   r,   s      r   r(   r(   5   s=      I C%TBBBB)T***r   c                 b    | j                             |g           }|st          ||           |S r+   )r   r   r   )r   r   r   s      r   r%   r%   =   s8    [__T2&&F C%TBBBBMr   )
__doc__r   r   astroid.exceptionsr   r   r   r)   r(   r%    r   r   <module>r1      s   
	 	      6 6 6 6 6 6
$ 
 
 
 
?$ ? ? ? ?&+ + + + +4      r   