관리-도구
편집 파일: apply.cpython-38.pyc
U -?�f6) � @ s� d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm Z d d lmZ d d lmZ d dlm Z d dlmZ d d lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm!Z! ddl"m#Z# ddl"m$Z$ dd l%m&Z& dd!l%m'Z' d"d#d$d%d&d'�d(d)�Z(d"d#d%d&d*�d+d,�Z)d#d-d.d/d/d&d0�d1d2�Z*d"d#d%d&d*�d3d4�Z+d#d"d5d5d&d6�d7d8�Z,d9S ):� )�annotations)�List)�Optional)�Union)� ARG_NAMED_OPT)�Argument)�AssignmentStmt)�CallExpr)�ClassDef)�MDEF)� MemberExpr)�NameExpr)�RefExpr)�StrExpr)�SymbolTableNode)�TempNode)�TypeInfo)�Var)�SemanticAnalyzerPluginInterface)�add_method_to_class)�AnyType)�get_proper_type)�Instance)�NoneTyp)� ProperType)� TypeOfAny)�UnboundType)� UnionType� )�infer)�util)�expr_to_mapped_constructor)�NAMED_TYPE_SQLA_MAPPEDr r zUnion[NameExpr, StrExpr]zList[util.SQLAlchemyAttribute]�None)�cls�api�item� attributes�returnc C s� t |t�r|j}nt |t�r$|j}nd S | jjD ]2}t |t�r0t |jd t�r0|jd j|kr0 q|q0t � |d|� �| � d S |jd kr�t � |d|� d S t|j�}t |t ttf�s�t�|�t j||j|j|| jd�� t|||jd |d � d S )Nr zCan't find mapped attribute zBStatement linked from _mypy_mapped_attrs has no typing information)�name�line�column�typ�info)� isinstancer r) r �value�defs�bodyr �lvaluesr Zfail�typer r r r �AssertionError�appendZSQLAlchemyAttributer* r+ r- �apply_type_to_mapped_statement)r$ r% r&