Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
row.cpython-313.pyc179 linesDownload Raw Back to __pycache__
1�

2��j�0���SrSSKJr SSKJr SSKJr SSKrSSKrSSKJ	r	 SSKJ3r4 SSKJr SSKJr SS	KJ
r
 SS5KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr \(d\(dSSKJr OSSK Jr \(aSSK!J"r" SSK!J#r# SSK!J$r$ \"S\	S9r%\"S\\	S 4S9r&"S!S"\\\	\\&5r'\r(\'r)"S#S$\5r*"S%S&\*\RVS'\RX\	5r-"S(S)\*\R\S'\	45r/"S*S+\\RS'\	45r0g),z.Define row constructs including :class:`.Row`.�)�annotations)�ABCN)�Any)�Callable)�Dict)�Generic)�Iterator)�List)�Mapping)�NoReturn)�Optional)�overload)�Sequence)�Tuple)�
TYPE_CHECKING)�TypeVar)�Union�)�util)�6deprecated)�HAS_CYEXTENSION�)�BaseRow)�_KeyType)�_ProcessorsType)�	RMKeyView�_T)�bound�_TP.c���\rSrSrSrSrS!SjrS"SjrS#Sjr\	"SS5S#S	j5r7\S#S8j5r\\	"SS5S#Sj55r
\S$S
j5rS%Sjr\(dS&Sjr\"S5r\"S5rS'SjrS(Sjr\R.r\(a\S)Sj5r\S*Sj5rS+SjrS,SjrS,SjrS,SjrS,SjrS,SjrS,SjrS-Sjr \S.Sj5r!S/Sjr"Sr#g )0�Row�2a�Represent a single result row.9 10The :class:`.Row` object represents a row of a database result.  It is11typically associated in the 1.x series of SQLAlchemy with the12:class:`_engine.CursorResult` object, however is also used by the ORM for13tuple-like results as of SQLAlchemy 1.4.14 15The :class:`.Row` object seeks to act as much like a Python named16tuple as possible.   For mapping (i.e. dictionary) behavior on a row,17such as testing for containment of keys, refer to the :attr:`.Row._mapping`18attribute.19 20.. seealso::21 22    :ref:`tutorial_selecting_data` - includes examples of selecting23    rows from SELECT statements.24 25.. versionchanged:: 1.426 27    Renamed ``RowProxy`` to :class:`.Row`. :class:`.Row` is no longer a28    "proxy" object in that it contains the final form of data within it,29    and now acts mostly like a named tuple. Mapping-like functionality is30    moved to the :attr:`.Row._mapping` attribute. See31    :ref:`change_4710_core` for background on this change.32 33�c��[S5e)Nzcan't set attribute��AttributeError)�self�name�values   �[D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/engine/row.py�__setattr__�Row.__setattr__Ps���2�3�3�c��[S5e)Nzcan't delete attributer%)r'r(s  r*�__delattr__�Row.__delattr__Ss���5�6�6r-c��U$)a�Return a 'tuple' form of this :class:`.Row`.34 35At runtime, this method returns "self"; the :class:`.Row` object is36already a named tuple. However, at the typing level, if this37:class:`.Row` is typed, the "tuple" return type will be a :pep:`484`38``Tuple`` datatype that contains typing information about individual39elements, supporting typed unpacking and attribute access.40 41.. versionadded:: 2.0.19 - The :meth:`.Row._tuple` method supersedes42   the previous :meth:`.Row.tuple` method, which is now underscored43   to avoid name conflicts with column names in the same way as other44   named-tuple methods on :class:`.Row`.45 46.. seealso::47 48    :attr:`.Row._t` - shorthand attribute notation49 50    :meth:`.Result.tuples`51 52 53r#�r's r*�_tuple�54Row._tupleVs	��,�r-z2.0.19z�The :meth:`.Row.tuple` method is deprecated in favor of :meth:`.Row._tuple`; all :class:`.Row` methods and library-level attributes are intended to be underscored to avoid name conflicts.  Please use :meth:`Row._tuple`.c�"�UR5$)zEReturn a 'tuple' form of this :class:`.Row`.55 56.. versionadded:: 2.057 58)r3r2s r*�tuple�	Row.tuplens���{�{�}�r-c��U$)a?A synonym for :meth:`.Row._tuple`.59 60.. versionadded:: 2.0.19 - The :attr:`.Row._t` attribute supersedes61   the previous :attr:`.Row.t` attribute, which is now underscored62   to avoid name conflicts with column names in the same way as other63   named-tuple methods on :class:`.Row`.64 65.. seealso::66 67    :attr:`.Result.t`68r#r2s r*�_t�Row._t}s	���r-z�The :attr:`.Row.t` attribute is deprecated in favor of :attr:`.Row._t`; all :class:`.Row` methods and library-level attributes are intended to be underscored to avoid name conflicts.  Please use :attr:`Row._t`.c��UR$)z;A synonym for :meth:`.Row._tuple`.69 70.. versionadded:: 2.071 72)r9r2s r*�t�Row.t�s
���w�w�r-c�Z�[URSURUR5$)a%Return a :class:`.RowMapping` for this :class:`.Row`.73 74This object provides a consistent Python mapping (i.e. dictionary)75interface for the data contained within the row.   The :class:`.Row`76by itself behaves like a named tuple.77 78.. seealso::79 80    :attr:`.Row._fields`81 82.. versionadded:: 1.483 84N)�85RowMapping�_parent�
_key_to_index�_datar2s r*�_mapping�Row._mapping�s#���$�,�,��d�.@�.@�$�*�*�M�Mr-c�X�[URXRUR5$�N)r!r@rArB)r'�	processors  r*�_filter_on_values�Row._filter_on_values�s!���4�<�<��,>�,>��86�87�K�Kr-c�*^�[SU4Sjj5nU$)z3Handle ambiguous names such as "count" and "index" c�~>^�TRRT5(aTRT5$SUU4SjjnU$)Nc�L>�[[RT5"T/UQ70UD6$rF)�getattr�collections_abcr)�arg�kwr(r's  ��r*�meth�4Row._special_name_accessor.<locals>.go.<locals>.meth�s0���&��'?�'?��F� � �#&� �*,� �r-)rOrrPr�returnr)r@�_has_key�__getattr__)r'rQr(s` �r*�go�&Row._special_name_accessor.<locals>.go�s:����<�<�(�(��.�.��+�+�D�1�1���88 �Kr-)r'r!rSr)�property)r(rVs` r*�_special_name_accessor�Row._special_name_accessor�s����89
 ��90
 ��Ir-�count�indexc��XR;$rF)rB�r'�keys  r*�__contains__�Row.__contains__�s���j�j� � r-c��[U[5(a%U"UR5UR55$U"UR5U5$rF)�91isinstancer!�_to_tuple_instance)r'�other�ops   r*�_op�Row._op�sN���%��%�%�
�t�&�&�(�%�*B�*B�*D�E�	92��D�+�+�-�u�5�	93r-c��grFr#�r'r\s  r*�__getitem__�Row.__getitem__�s��25r-c��grFr#rjs  r*rkrl�s��>Ar-c��grFr#rjs  r*rkrl�s��r-c�B�URU[R5$rF)rg�operator�lt�r'res  r*�__lt__�94Row.__lt__�����x�x��x�{�{�+�+r-c�B�URU[R5$rF)rgrp�lerrs  r*�__le__�95Row.__le__�rur-c�B�URU[R5$rF)rgrp�gerrs  r*�__ge__�96Row.__ge__�rur-c�B�URU[R5$rF)rgrp�gtrrs  r*�__gt__�97Row.__gt__�rur-c�B�URU[R5$rF)rgrp�eqrrs  r*�__eq__�98Row.__eq__�rur-c�B�URU[R5$rF)rgrp�nerrs  r*�__ne__�99Row.__ne__�rur-c�@�[[R"U55$rF)�repr�sql_util�	_repr_rowr2s r*�__repr__�Row.__repr__�s���H�&�&�t�,�-�-r-c�t�[URRVs/sH	ocMUPM sn5$s snf)aaReturn a tuple of string keys as represented by this100:class:`.Row`.101 102The keys can represent the labels of the columns returned by a core103statement or the names of the orm classes returned by an orm104execution.105 106This attribute is analogous to the Python named tuple ``._fields``107attribute.108 109.. versionadded:: 1.4110 111.. seealso::112 113    :attr:`.Row._mapping`114 115)r6r@�keys)r'�ks  r*�_fields�Row._fields�s-��&����!2�!2�D�!2�A�a�!2�D�E�E��Ds�5�5c�,�[UR5$)a-Return a new dict which maps field names to their corresponding116values.117 118This method is analogous to the Python named tuple ``._asdict()``119method, and works by applying the ``dict()`` constructor to the120:attr:`.Row._mapping` attribute.121 122.. versionadded:: 1.4123 124.. seealso::125 126    :attr:`.Row._mapping`127 128)�dictrCr2s r*�_asdict�Row._asdict	s���D�M�M�"�"r-N)r(�strr)rrSr)r(r�rSr)rSr)rSr?)rGzOptional[_ProcessorsType]rSzRow[Any])r(r�rSr)r_rrS�bool)rerrfzCallable[[Any, Any], bool]rSr�)r\�intrSr)r\�slicerS�
Sequence[Any])r\zUnion[int, slice]rSr�rerrSr��rSr�)rSzTuple[str, ...])rSzDict[str, Any])$�__name__�129__module__�__qualname__�__firstlineno__�__doc__�	__slots__r+r/r3rr6rXr9r<rCrHrrYr[r\r`rgr�__hash__rrkrsrxr|r�r�r�r�r�r��__static_attributes__r#r-r*r!r!2sA���6�I�4�7��0��	C������������	?�������N��N� L�2�L�	�L�130�	�$'�w�/��&�w�/��!�131����H��	�5�132�5�	�A�133�A�C�,�,�,�,�,�,�.��F��F�(#r-r!c�|�\rSrSr%SrS\S'S\S'SSjrSSjrSS	jrSS134jr	SSjr135SSjrSS
jrSr
g)�
ROMappingViewir#r��_items�Mapping['_KeyType', Any]rCc��XlX lgrF)rCr�)r'�mapping�itemss   r*�__init__�ROMappingView.__init__%s�� �
��r-c�,�[UR5$rF)�lenr�r2s r*�__len__�ROMappingView.__len__+s���4�;�;��r-c�$�SRU5$)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr2s r*r��ROMappingView.__repr__.s��7�>�>�t�D�Dr-c�,�[UR5$rF)�iterr�r2s r*�__iter__�ROMappingView.__iter__1s���D�K�K� � r-c��XR;$rF�r�)r'�items  r*r`�ROMappingView.__contains__4s���{�{�"�"r-c�0�[U5[U5:H$rF��listrrs  r*r��ROMappingView.__eq__7����E�{�d�4�j�(�(r-c�0�[U5[U5:g$rFr�rrs  r*r��ROMappingView.__ne__:r�r-)r�rCN)r�r�r�r��rSr�r�)rSz
Iterator[Any])r�rrSr�r�)r�r�r�r�r��__annotations__r�r�r�r�r`r�r�r�r#r-r*r�r�sG���I���&�&��/��8E�� �E�!�#�)�)r-r�c��\rSrSrSrSrg)�ROMappingKeysValuesViewi>r�r#N�r�r�r�r�r�r�r#r-r*r�r�>s	���Ir-r�rc��\rSrSrSrSrg)�ROMappingItemsViewiDr�r#Nr�r#r-r*r�r�Ds���Ir-r�c��\rSrSrSrSr\(aSSjrO\RrSSjr136SSjrSSjrSSjr
SS	jrSS137jrSSjrSSjrSrg
)r?iHa�A ``Mapping`` that maps column names and objects to :class:`.Row`138values.139 140The :class:`.RowMapping` is available from a :class:`.Row` via the141:attr:`.Row._mapping` attribute, as well as from the iterable interface142provided by the :class:`.MappingResult` object returned by the143:meth:`_engine.Result.mappings` method.144 145:class:`.RowMapping` supplies Python mapping (i.e. dictionary) access to146the  contents of the row.   This includes support for testing of147containment of specific keys (string column names or objects), as well148as iteration of keys, values, and items::149 150    for row in result:151        if "a" in row._mapping:152            print("Column 'a': %s" % row._mapping["a"])153 154        print("Column b: %s" % row._mapping[table.c.b])155 156.. versionadded:: 1.4 The :class:`.RowMapping` object replaces the157   mapping-like access previously provided by a database result row,158   which now seeks to behave mostly like a named tuple.159 160r#c��grFr#r^s  r*rk�RowMapping.__getitem__fs��Sr-c�,�[UR5$rF)r�rBr2s r*�_values_impl�RowMapping._values_implks���D�J�J��r-c�<�SURR5$)Nc3�.# �UHocMUv� M
 g7frFr#)�.0r�s  r*�	<genexpr>�&RowMapping.__iter__.<locals>.<genexpr>os���>�,�a���,�s��	�r@r�r2s r*r��RowMapping.__iter__ns��>�4�<�<�,�,�>�>r-c�,�[UR5$rF)r�rBr2s r*r��RowMapping.__len__qs���4�:�:��r-c�8�URRU5$rF)r@rTr^s  r*r`�RowMapping.__contains__ts���|�|�$�$�S�)�)r-c�*�[[U55$rF)r�r�r2s r*r��RowMapping.__repr__ws���D��J��r-c	�f�[XR5Vs/sHoX4PM161 sn5$s snf)zUReturn a view of key/value tuples for the elements in the162underlying :class:`.Row`.163 164)r�r�r^s  r*r��RowMapping.itemszs1��165"��y�y�{�;�{����#�{�;�166�	167��;s�.168c�.�URR$)z^Return a view of 'keys' for string column names represented169by the underlying :class:`.Row`.170 171r�r2s r*r��RowMapping.keys�s���|�|� � � r-c�4�[XR55$)zUReturn a view of values for the values represented in the172underlying :class:`.Row`.173 174)r�r�r2s r*�values�RowMapping.values�s��175'�t�->�->�-@�A�Ar-N)r_rrSr)rSz	List[Any])rSz
Iterator[str]r�)r_�objectrSr�r�)rSr�)rSr)rSr�)r�r�r�r�r�r�rrkr�_get_by_key_impl_mappingr�r�r�r`r�r�r�r�r�r#r-r*r?r?HsJ���2�I��8��6�6�� �?��*� �176�!�Br-r?)1r��177__future__r�abcr�collections.abcrNrp�typingrrrrr	r178rrr
rrrrrr�sqlrr�r�util._has_cyr�_py_rowr�"sqlalchemy.cyextension.resultproxy�resultrrrrrr!�BaseRowProxy�RowProxyr��KeysView�179ValuesViewr��	ItemsViewr�r?r#r-r*�<module>r�s��5�"��)��
������������� ���"��*���+�E�� �'�!��T����
�e�5��c��?�+��f#�'�8�C�=�'�#�,�f#�R����)�C�)�>��6�?�?�:�.��0A�0A�#�0F�����(8�(8��S��(I��HB��&�.�.��S��9�HBr-
codekingpro/portable-devtools · Team Ai