관리-도구
편집 파일: dunder_lookup.cpython-311.pyc
� �܋f| � �V � d Z ddlZddlZddlmZ defd�Zdefd�Zdefd�Zdefd�Z dS ) 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 � �fd�| � d�� � D � � � � }t t j ||� � � � }|st �| �� � �|S )Nc 3 �N �K � | ]}|j � �g � � V � � d S )N)�locals�get)�.0�ancestor�names ��r/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/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� �� ��K�O�O�D�"�%�%�E��O�)�)� *� *� *� *�6:�n�n�D�n�6Q�6Q�*� *� *� � �E� �)�/�%��/�/� 0� 0�F�� C�%��T�B�B�B�B��Mr c �z � t | t j t j t j t j t j f� � rt | |� � S t | t j � � rt | |� � S t | t j � � rt | |� � S t || �� � �)z�Lookup 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) "