Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/astroid/nodes/scoped_nodes/__pycache__/scoped_nodes.cpython-39.pyc
Ðазад
a k�h�� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlmZm Z m Z mZ ddlm Z mZ ddlmZmZmZmZmZmZ ddlmZmZmZ ddlmZmZmZmZ dd lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) dd l*m+Z+ ddl,m-Z-m.Z.m/Z/ ddl0m1Z1 dd l2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZBmCZCmDZDmEZE e�r�ddlmFZFmGZG ddlHmIZI dZJeKddh�ZLeKh d��ZMed�ZNdd� ZOddd�dd�ZPdd d!dd"�d#d$�ZQd%d&� ZRG d'd(� d(e<�ZSG d)d*� d*e;�ZTG d+d,� d,e;�ZUG d-d.� d.e;�ZVG d/d0� d0e;�ZWd1d2� ZXG d3d4� d4e7jYe<�ZZG d5d6� d6e7j[e7jYe7j\e<�Z]G d7d8� d8e]�Z^dEd d9d!d:d;�d<d=�Z_dFd d9d!d>d?�d@dA�Z`dBdC� ZaG dDd � d e7jYe<e7j\�ZbdS )Gz� This module contains the classes for "scoped" node, i.e. which are opening a new local scope in the language definition : Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent). � )�annotationsN)� Generator�Iterable�Iterator�Sequence)�cached_property� lru_cache)� TYPE_CHECKING�Any�ClassVar�Literal�NoReturn�TypeVar)�bases� protocols�util)�CallContext�InferenceContext�bind_context_to_node�copy_context) �AstroidBuildingError�AstroidTypeError�AttributeInferenceError�DuplicateBasesError�InconsistentMroError�InferenceError�MroError�ParentMissingError�StatementMissing�TooManyLevelsError)�lookup)� ClassModel� FunctionModel�ModuleModel)�AstroidManager)� Arguments�Const�NodeNG�Unknown�_base_nodes� const_factory�node_classes)�ComprehensionScope�LocalsDictNodeNG)�builtin_lookup)�Position)� InferBinaryOp�InferenceErrorInfo�InferenceResult�SuccessfulInferenceResult)�nodes�objects)�LookupMixIn)�__iter__�__getitem__� Exception� BaseException> �builtins.staticmethod�builtins.classmethod�staticmethod�classmethod�_Tc C s� g }dd� | D �} | s|S | D ]2}|d }| D ]}||dd� v r.d} qq. qRq|sft d| ||d��|�|� | D ]}|d |krt|d= qtqdS )z�Merges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from http://www.python.org/download/releases/2.3/mro/. c S s g | ]}|r|�qS � r@ )�.0�sr@ r@ ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py� <listcomp>T � z_c3_merge.<locals>.<listcomp>r � NzTCannot create a consistent method resolution order for MROs {mros} of class {cls!r}.��messageZmros�cls�context)r �append)� sequencesrI rJ �result�s1� candidate�s2�seqr@ r@ rC � _c3_mergeL s. � rR zlist[list[ClassDef]]�None)rL �returnc C s� | dd� }| d }t |�D ]\}}|�� dkr|} q>qdS t |�D ](\}}||krXqFtdd� |D ��rF qtqFdS |�|� |�|� dS )a� A class can inherit from typing.Generic directly, as base, and as base of bases. The merged MRO must however only contain the last entry. To prepare for _c3_merge, remove some typing.Generic entries from sequences if multiple are present. This method will check if Generic is in inferred_bases and also part of bases_mro. If true, remove it from inferred_bases as well as its entry the bases_mro. Format sequences: [[self]] + bases_mro + [inferred_bases] rF ����typing.GenericNc s s | ]}|� � d kV qdS )rV N��qname�rA �baser@ r@ rC � <genexpr>� rE z+clean_typing_generic_mro.<locals>.<genexpr>)� enumeraterX �any�pop)rL � bases_mro�inferred_bases�irZ Zposition_in_inferred_basesrQ r@ r@ rC �clean_typing_generic_mror s rb �ClassDef�InferenceContext | None)rL rI rJ rT c C sN | D ]D}t � }|D ]4}|j|�� f}||v r<td| ||d��|�|� qq| S )Nz,Duplicates found in MROs {mros} for {cls!r}.rG )�set�linenorX r �add)rL rI rJ �sequence�seen�nodeZlineno_and_qnamer@ r@ rC �clean_duplicates_mro� s �rk c C sF t | t�rB| jdkr t�| |�S | jdkr.| S | jdkrBt�| �S | S )Nr>