관리-도구
편집 파일: annotation.cpython-37.pyc
B ��4]� � @ s` d Z ddlmZ ddlmZ G dd� de�Zi Zddd �Zdd d�Zdd � Z dd� Z dd� ZdS )z�The :class:`.Annotated` class and related routines; creates hash-equivalent copies of SQL constructs which contain context-specific markers and associations. � )� operators� )�utilc @ sn e Zd ZdZdd� Zdd� Zdd� Zdd � Zddd �Zdd� Z e dd� �Zdd� Zdd� Z dd� Zdd� Zd S )� AnnotatedaE clones a ClauseElement and applies an 'annotations' dictionary. Unlike regular clones, this clone also mimics __hash__() and __cmp__() of the original element so that it takes its place in hashed collections. A reference to the original element is maintained, for the important reason of keeping its hash value current. When GC'ed, the hash value may be reused, causing conflicts. .. note:: The rationale for Annotated producing a brand new class, rather than placing the functionality directly within ClauseElement, is **performance**. The __hash__() method is absent on plain ClauseElement which leads to significantly reduced function call overhead, as the use of sets and dictionaries against ClauseElement objects is prevalent, but most are not "annotated". c G sT |st �| �S |\}}yt|j } W n tk rD t|j| �} Y nX t �| �S d S )N)�object�__new__�annotated_classes� __class__�KeyError�_new_annotation_type)�cls�args�element�values� r �L/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/annotation.pyr &