Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/astroid/interpreter/__pycache__/dunder_lookup.cpython-39.pyc
Ðазад
a k�h� � @ s� d Z ddlmZ ddlZddlmZ ddlZddlmZ erTddlm Z ddl mZ dd �d d�Zddd ddd�dd�Z ddd ddd�dd�Zdd �dd�ZdS )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. � )�annotationsN)� TYPE_CHECKING)�AttributeInferenceError)�nodes)�InferenceContext�list)�returnc sT | j �� g �}tj�� fdd�| jdd�D ��}tt�||��}|sPt� | d��|S )Nc 3 s | ]}|j �� g �V qd S )N)�locals�get)�.0Zancestor��name� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/astroid/interpreter/dunder_lookup.py� <genexpr> s z!_lookup_in_mro.<locals>.<genexpr>T)Zrecurs�� attribute�target)r r � itertools�chain� from_iterableZ ancestorsr r )�noder �attrsr �valuesr r r �_lookup_in_mro s �r znodes.NodeNG�strzInferenceContext | None)r r �contextr c C sh t | tjtjtjtjtjf�r(t| |�S t | tj�r>t | |�S t | tj �rXt| ||d�S t|| d��dS )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 r N) � isinstance�astroid�List�TupleZConst�Dict�Set�_builtin_lookup�Instancer �ClassDef� _class_lookupr )r r r r r r �lookup) s � r( znodes.ClassDefc C s* | j |d�}|d u r t|| d��t||�S )Nr r )� metaclassr r )r r r r) r r r r'