HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyc
�
���ec@s
dZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddl"m#Z#ddl"m$Z$dd l"m%Z%dd!l"m&Z&d"e'fd#��YZ(d$e'fd%��YZ)d&e'fd'��YZ*d(e)efd)��YZ+d*e+fd+��YZ,d,e+fd-��YZ-d.e,fd/��YZ.d0e(efd1��YZ/d2e/fd3��YZ0d4e/fd5��YZ1d6e(efd7��YZ2d8e2fd9��YZ3d:e(efd;��YZ4d<e(efd=��YZ5d>e(efd?��YZ6d@efdA��YZ7dBe7fdC��YZ8dDefdE��YZ9dFee+e9fdG��YZ:dHefdI��YZ;dJeee9fdK��YZ<dLe(efdM��YZ=dNee=efdO��YZ>dPe*efdQ��YZ?dRee*e)efdS��YZ@dTefdU��YZAdVe3fdW��YZBdXe3fdY��YZCdZe2fd[��YZDd\e2fd]��YZEd^e/fd_��YZFeFZGd`e0fda��YZHdbe1fdc��YZIdde4fde��YZJdfe4fdg��YZKdhe5fdi��YZLdje6fdk��YZMdle,fdm��YZNdne,fdo��YZOdpe+fdq��YZPdre-fds��YZQdte+fdu��YZRdve-fdw��YZSdxe8fdy��YZTdze7fd{��YZUd|e7fd}��YZVd~e<fd��YZWd�efd���YZXd�eefd���YZYd�e<fd���YZZeX�Z[e<�Z\e+�Z]e/�Z^e2�Z_eZ�Z`eY�Zae4d�eb�Zce6d�eb�Zdi	e/�ee6e3�ef6e\eg6e2�ejh6e5�eji6e4�ej6e6�ejj6e>�ejk6e[e"jl6Zme"jnr}e8�emeo<e-�emep<ne-�emeq<e+�emep<emjrZsd��Zte\e_\e]e_]e^e_^e[e_[e_e__e`e_`e*e_ueae_aete_te\ejv_\dS(�sSQL specific types.

i����Ni(t	coercions(telements(t	operators(troles(ttype_api(t_bind_or_error(tNO_ARG(tSchemaEventTarget(t
_NONE_NAME(tquoted_name(tSlice(t
TypeCoerce(tHasCacheKey(tInternalTraversal(tEmulated(tNativeForEmulated(tto_instance(t
TypeDecorator(t
TypeEngine(tVarianti(tevent(texc(t
inspection(t
processors(tutil(tcompat(tlanghelpers(tOrderedDict(tpicklet_LookupExpressionAdaptercBs<eZdZed��Zdejfd��YZeZRS(s�Mixin expression adaptations based on lookup tables.

    These rules are currently used by the numeric, integer and date types
    which have detailed cross-expression coercion rules.

    cCs
t��dS(N(tNotImplementedError(tself((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_expression_adaptations9st
ComparatorcBseZej�Zd�ZRS(cCs�|jj}|jjj||j�j||j�}||krO||jfS||jjkrn||jfS|t|�fSdS(N(ttypet_type_affinityR tgett_blank_dictR(Rtoptother_comparatort	othertypetlookup((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_adapt_expression@s

(t__name__t
__module__Rt
immutabledictR%R*(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!=s(R+R,t__doc__tpropertyR RR!tcomparator_factory(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR0stConcatenablecBs-eZdZdejfd��YZeZRS(sOA mixin that marks a type as supporting 'concatenation',
    typically strings.R!cBseZd�ZRS(cCs]|tjkr=t|tjtjf�r=tj|jjfSt	tj|�j
||�SdS(N(Rtaddt
isinstanceR1R!tNullTypet	concat_optexprR"tsuperR*(RR&R'((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR*Us(R+R,R*(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!Ts(R+R,R.RR!R0(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR1Ost	IndexablecBs-eZdZdejfd��YZeZRS(s�A mixin that marks a type as supporting indexing operations,
    such as array or JSON structures.


    .. versionadded:: 1.1.0


    R!cBseZd�Zd�ZRS(cCs
t��dS(N(R(Rtindex((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_setup_getitemnscCs.|j|�\}}}|j||d|�S(Ntresult_type(R:toperate(RR9tadjusted_optadjusted_right_exprR;((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__getitem__qs(R+R,R:R?(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!ms	(R+R,R.RR!R0(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR8cstStringcBs�eZdZdZejdd�Zejdd�Zejdd�Zejdd	�Z	ej
d
dd
d�ddedeed��Z
d�Zd�Zd�Zed��Zd�Zed��ZRS(s�The base for all string and character types.

    In SQL, corresponds to VARCHAR.  Can also take Python unicode objects
    and encode to the database's encoding in bind params (and the reverse for
    result sets.)

    The `length` field is usually required when the `String` type is
    used within a CREATE TABLE statement, as VARCHAR requires a length
    on most databases.

    tstringtRETURNS_UNICODEsIndicates that the DBAPI returns Python Unicode for VARCHAR,
        NVARCHAR, and other character-based datatypes in all cases.

        This is the default value for
        :attr:`.DefaultDialect.returns_unicode_strings` under Python 3.

        .. versionadded:: 1.4

        t
RETURNS_BYTESsRIndicates that the DBAPI returns byte objects under Python 3
        or non-Unicode string objects under Python 2 for VARCHAR, NVARCHAR,
        and other character-based datatypes in all cases.

        This may be applied to the
        :attr:`.DefaultDialect.returns_unicode_strings` attribute.

        .. versionadded:: 1.4

        tRETURNS_CONDITIONALs�Indicates that the DBAPI may return Unicode or bytestrings for
        VARCHAR, NVARCHAR, and other character-based datatypes, and that
        SQLAlchemy's default String datatype will need to test on a per-row
        basis for Unicode or bytes.

        This may be applied to the
        :attr:`.DefaultDialect.returns_unicode_strings` attribute.

        .. versionadded:: 1.4

        tRETURNS_UNKNOWNsIndicates that the dialect should test on first connect what the
        string-returning behavior of character-based datatypes is.

        This is the default value for DefaultDialect.unicode_returns under
        Python 2.

        This may be applied to the
        :attr:`.DefaultDialect.returns_unicode_strings` attribute under
        Python 2 only.   The value is disallowed under Python 3.

        .. versionadded:: 1.4

        .. deprecated:: 1.4  This value will be removed in SQLAlchemy 2.0.

        tconvert_unicodes1.3s�The :paramref:`.String.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.t
unicode_errors�The :paramref:`.String.unicode_errors` parameter is deprecated and will be removed in a future release.  This parameter is unnecessary for modern Python DBAPIs and degrades performance significantly.cCsa|dk	r*|dkr*tjd��n||_||_|pE||_||_||_dS(sL
        Create a string-holding type.

        :param length: optional, a length for the column for use in
          DDL and CAST expressions.  May be safely omitted if no ``CREATE
          TABLE`` will be issued.  Certain databases may require a
          ``length`` for use in DDL, and will raise an exception when
          the ``CREATE TABLE`` DDL is issued if a ``VARCHAR``
          with no length is included.  Whether the value is
          interpreted as bytes or characters is database specific.

        :param collation: Optional, a column-level collation for
          use in DDL and CAST expressions.  Renders using the
          COLLATE keyword supported by SQLite, MySQL, and PostgreSQL.
          E.g.::

            >>> from sqlalchemy import cast, select, String
            >>> print(select(cast('some string', String(collation='utf8'))))
            SELECT CAST(:param_1 AS VARCHAR COLLATE utf8) AS anon_1

        :param convert_unicode: When set to ``True``, the
          :class:`.String` type will assume that
          input is to be passed as Python Unicode objects under Python 2,
          and results returned as Python Unicode objects.
          In the rare circumstance that the DBAPI does not support
          Python unicode under Python 2, SQLAlchemy will use its own
          encoder/decoder functionality on strings, referring to the
          value of the :paramref:`_sa.create_engine.encoding` parameter
          parameter passed to :func:`_sa.create_engine` as the encoding.

          For the extremely rare case that Python Unicode
          is to be encoded/decoded by SQLAlchemy on a backend
          that *does* natively support Python Unicode,
          the string value ``"force"`` can be passed here which will
          cause SQLAlchemy's encode/decode services to be
          used unconditionally.

          .. note::

            SQLAlchemy's unicode-conversion flags and features only apply
            to Python 2; in Python 3, all string objects are Unicode objects.
            For this reason, as well as the fact that virtually all modern
            DBAPIs now support Unicode natively even under Python 2,
            the :paramref:`.String.convert_unicode` flag is inherently a
            legacy feature.

          .. note::

            In the vast majority of cases, the :class:`.Unicode` or
            :class:`.UnicodeText` datatypes should be used for a
            :class:`_schema.Column` that expects to store non-ascii data.
            These
            datatypes will ensure that the correct types are used on the
            database side as well as set up the correct Unicode behaviors
            under Python 2.

          .. seealso::

            :paramref:`_sa.create_engine.convert_unicode` -
            :class:`_engine.Engine`-wide parameter

        :param unicode_error: Optional, a method to use to handle Unicode
          conversion errors. Behaves like the ``errors`` keyword argument to
          the standard library's ``string.decode()`` functions, requires
          that :paramref:`.String.convert_unicode` is set to
          ``"force"``

        tforces:convert_unicode must be 'force' when unicode_error is set.N(tNoneRt
ArgumentErrortlengtht	collationt_expect_unicodet_expect_unicode_errort_warn_on_bytestring(RRKRLRFRGRORM((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__init__�s]			cs�fd�}|S(Ncs;|jdd�}�jjr3|jdd�}nd|S(Nt's''t%s%%s'%s'(treplacetidentifier_preparert_double_percents(tvalue(tdialect(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytprocess5s((RRWRX((RWsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytliteral_processor4scs��js|jr{|jrG�jdkrG�jr@d�}|SdSn0tj|j���j����fd�}|SdSdS(NRHcSs5t|tj�r1tjdtj|�f�n|S(Ns6Unicode type received non-unicode bind param value %r.(R3Rtbinary_typetwarn_limitedtellipses_string(RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXGs
cs[t|tj�r&�|�j�dS�rW|dk	rWtjdtj|�f�n|S(Nis6Unicode type received non-unicode bind param value %r.(R3Rt	text_typeRNRIR[R\(RV(tencoderRtwarn_on_bytestring(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXWs(RMRFtsupports_unicode_bindsRORItcodecst
getencodertencoding(RRWRX((R^RR_sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytbind_processor?s					cCs�|jp|j}|o6|jtjk	p6|jdk}|of|jtjtjfkof|jdk}|r�|r�tj|j|j	�Stj
|j|j	�SndSdS(NRHt
force_nocheck(RHRe(RMRFtreturns_unicode_stringsR@RBRDRt(to_conditional_unicode_processor_factoryRcRNtto_unicode_processor_factoryRI(RRWtcoltypet
wants_unicodet
needs_converttneeds_isinstance((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytresult_processorfs cCs|jrtjStSdS(N(RMRR]tstr(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytpython_type�s	cCs|jS(N(tSTRING(Rtdbapi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytget_dbapi_type�scCstjddd�dS(NsThe convert_unicode on Engine and String as well as the unicode_error flag on String are deprecated.  All modern DBAPIs now support Python Unicode natively under Python 2, and under Python 3 all strings are inherently Unicode.  These flags will be removed in a future release.tversions1.3(Rtwarn_deprecated(tcls((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_warn_deprecated_unicode�s(s1.3s�The :paramref:`.String.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.(s1.3s�The :paramref:`.String.unicode_errors` parameter is deprecated and will be removed in a future release.  This parameter is unnecessary for modern Python DBAPIs and degrades performance significantly.N(R+R,R.t__visit_name__RtsymbolRBRCRDREtdeprecated_paramsRItFalseRPRYRdRmR/RoRrtclassmethodRv(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR@~s>		
				R		'		tTextcBseZdZdZRS(sjA variably sized string type.

    In SQL, usually corresponds to CLOB or TEXT. Can also take Python
    unicode objects and encode to the database's encoding in bind
    params (and the reverse for result sets.)  In general, TEXT objects
    do not have a length; while some databases will accept a length
    argument here, it will be rejected by others.

    ttext(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR|�s
tUnicodecBs eZdZdZdd�ZRS(s"
A variable length Unicode string type.

    The :class:`.Unicode` type is a :class:`.String` subclass that assumes
    input and output strings that may contain non-ASCII characters, and for
    some backends implies an underlying column type that is explicitly
    supporting of non-ASCII data, such as ``NVARCHAR`` on Oracle and SQL
    Server.  This will impact the output of ``CREATE TABLE`` statements and
    ``CAST`` functions at the dialect level, and also in some cases will
    indicate different behavior in the DBAPI itself in how it handles bound
    parameters.

    The character encoding used by the :class:`.Unicode` type that is used to
    transmit and receive data to the database is usually determined by the
    DBAPI itself. All modern DBAPIs accommodate non-ASCII strings but may have
    different methods of managing database encodings; if necessary, this
    encoding should be configured as detailed in the notes for the target DBAPI
    in the :ref:`dialect_toplevel` section.

    In modern SQLAlchemy, use of the :class:`.Unicode` datatype does not
    typically imply any encoding/decoding behavior within SQLAlchemy itself.
    Historically, when DBAPIs did not support Python ``unicode`` objects under
    Python 2, SQLAlchemy handled unicode encoding/decoding services itself
    which would be controlled by the flag :paramref:`.String.convert_unicode`;
    this flag is deprecated as it is no longer needed for Python 3.

    When using Python 2, data that is passed to columns that use the
    :class:`.Unicode` datatype must be of type ``unicode``, and not ``str``
    which in Python 2 is equivalent to ``bytes``.  In Python 3, all data
    passed to columns that use the :class:`.Unicode` datatype should be
    of type ``str``.   See the flag :paramref:`.String.convert_unicode` for
    more discussion of unicode encode/decode behavior under Python 2.

    .. warning:: Some database backends, particularly SQL Server with pyodbc,
       are known to have undesirable behaviors regarding data that is noted
       as being of ``NVARCHAR`` type as opposed to ``VARCHAR``, including
       datatype mismatch errors and non-use of indexes.  See the section
       on :meth:`.DialectEvents.do_setinputsizes` for background on working
       around unicode character issues for backends like SQL Server with
       pyodbc as well as cx_Oracle.

    .. seealso::

        :class:`.UnicodeText` - unlengthed textual counterpart
        to :class:`.Unicode`.

        :paramref:`.String.convert_unicode`

        :meth:`.DialectEvents.do_setinputsizes`


    tunicodecKs@|jdt�|jdt�tt|�jd||�dS(s�
        Create a :class:`.Unicode` object.

        Parameters are the same as that of :class:`.String`,
        with the exception that ``convert_unicode``
        defaults to ``True``.

        RMRORKN(t
setdefaulttTrueR7R~RP(RRKtkwargs((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�s	N(R+R,R.RwRIRP(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR~�s4tUnicodeTextcBs)eZdZdZdd�Zd�ZRS(s#An unbounded-length Unicode string type.

    See :class:`.Unicode` for details on the unicode
    behavior of this object.

    Like :class:`.Unicode`, usage the :class:`.UnicodeText` type implies a
    unicode-capable type being used on the backend, such as
    ``NCLOB``, ``NTEXT``.

    tunicode_textcKs@|jdt�|jdt�tt|�jd||�dS(s�
        Create a Unicode-converting Text type.

        Parameters are the same as that of :class:`_expression.TextClause`,
        with the exception that ``convert_unicode``
        defaults to ``True``.

        RMRORKN(R�R�R7R�RP(RRKR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�s	cCsdS(N((R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRvsN(R+R,R.RwRIRPRv(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
tIntegercBsGeZdZdZd�Zed��Zd�Zej	d��Z
RS(sA type for ``int`` integers.tintegercCs|jS(N(tNUMBER(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRrscCstS(N(tint(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRoscCs
d�}|S(NcSstt|��S(N(RnR�(RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXs((RRWRX((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRYs	cCs�iitt6|jt6tt6tj6itt6|jt6tt6tj6i|jt6tt6tj6i|jt6tt6tj	6i|jt6tt6tj
6S(N(tDatet	__class__R�tNumericRR2tIntervaltmultdivttruedivtsub(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR s

(R+R,R.RwRrR/RoRYRtmemoized_propertyR (((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s		tSmallIntegercBseZdZdZRS(s�A type for smaller ``int`` integers.

    Typically generates a ``SMALLINT`` in DDL, and otherwise acts like
    a normal :class:`.Integer` on the Python side.

    t
small_integer(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�4st
BigIntegercBseZdZdZRS(s�A type for bigger ``int`` integers.

    Typically generates a ``BIGINT`` in DDL, and otherwise acts like
    a normal :class:`.Integer` on the Python side.

    tbig_integer(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�@sR�cBs�eZdZdZdZddded�Zed��Z	d�Z
d�Zed��Zd�Z
d	�Zejd
��ZRS(s�Base for non-integer numeric types, such as
    ``NUMERIC``, ``FLOAT``, ``DECIMAL``, and other variants.

    The :class:`.Numeric` datatype when used directly will render DDL
    corresponding to precision numerics if available, such as
    ``NUMERIC(precision, scale)``.  The :class:`.Float` subclass will
    attempt to render a floating-point datatype such as ``FLOAT(precision)``.

    :class:`.Numeric` returns Python ``decimal.Decimal`` objects by default,
    based on the default value of ``True`` for the
    :paramref:`.Numeric.asdecimal` parameter.  If this parameter is set to
    False, returned values are coerced to Python ``float`` objects.

    The :class:`.Float` subtype, being more specific to floating point,
    defaults the :paramref:`.Float.asdecimal` flag to False so that the
    default Python datatype is ``float``.

    .. note::

        When using a :class:`.Numeric` datatype against a database type that
        returns Python floating point values to the driver, the accuracy of the
        decimal conversion indicated by :paramref:`.Numeric.asdecimal` may be
        limited.   The behavior of specific numeric/floating point datatypes
        is a product of the SQL datatype in use, the Python :term:`DBAPI`
        in use, as well as strategies that may be present within
        the SQLAlchemy dialect in use.   Users requiring specific precision/
        scale are encouraged to experiment with the available datatypes
        in order to determine the best results.

    tnumerici
cCs(||_||_||_||_dS(sw
        Construct a Numeric.

        :param precision: the numeric precision for use in DDL ``CREATE
          TABLE``.

        :param scale: the numeric scale for use in DDL ``CREATE TABLE``.

        :param asdecimal: default True.  Return whether or not
          values should be sent as Python Decimal objects, or
          as floats.   Different DBAPIs send one or the other based on
          datatypes - the Numeric type will ensure that return values
          are one or the other across DBAPIs consistently.

        :param decimal_return_scale: Default scale to use when converting
         from floats to Python decimals.  Floating point values will typically
         be much longer due to decimal inaccuracy, and most floating point
         database types don't have a notion of "scale", so by default the
         float type looks for the first ten decimal places when converting.
         Specifying this value will override that length.  Types which
         do include an explicit ".scale" value, such as the base
         :class:`.Numeric` as well as the MySQL float types, will use the
         value of ".scale" as the default for decimal_return_scale, if not
         otherwise specified.

        When using the ``Numeric`` type, care should be taken to ensure
        that the asdecimal setting is appropriate for the DBAPI in use -
        when Numeric applies a conversion from Decimal->float or float->
        Decimal, this conversion incurs an additional performance overhead
        for all result columns received.

        DBAPIs that return Decimal natively (e.g. psycopg2) will have
        better accuracy and higher performance with a setting of ``True``,
        as the native translation to Decimal reduces the amount of floating-
        point issues at play, and the Numeric type itself doesn't need
        to apply any further conversions.  However, another DBAPI which
        returns floats natively *will* incur an additional conversion
        overhead, and is still subject to floating point data loss - in
        which case ``asdecimal=False`` will at least remove the extra
        conversion overhead.

        N(t	precisiontscaletdecimal_return_scalet	asdecimal(RR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPqs1			cCs@|jdk	r|jSt|dd�dk	r5|jS|jSdS(NR�(R�RItgetattrR�t_default_decimal_return_scale(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_effective_decimal_return_scale�s
cCs|jS(N(R�(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRr�scCs
d�}|S(NcSs
t|�S(N(Rn(RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s((RRWRX((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�s	cCs|jrtjStSdS(N(R�tdecimaltDecimaltfloat(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�s	cCs|jr
dStjSdS(N(tsupports_native_decimalRIRtto_float(RRW((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s	cCs||jrd|jrdStjd|j|jf�tjt	j
|jdk	rW|jn|j�Sn|jrttj
SdSdS(Ns�Dialect %s+%s does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.(R�R�RIRtwarntnametdriverRtto_decimal_processor_factoryR�R�R�R�R�(RRWRi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�s		
	cCs�iitt6|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj	6S(N(
R�R�R�R�RR�R�R�R2R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR �s

N(R+R,R.RwR�RIR�RPR/R�RrRYRoRdRmRR�R (((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�Ls1					tFloatcBs5eZdZdZdZdedd�Zd�ZRS(s
Type representing floating point types, such as ``FLOAT`` or ``REAL``.

    This type returns Python ``float`` objects by default, unless the
    :paramref:`.Float.asdecimal` flag is set to True, in which case they
    are coerced to ``decimal.Decimal`` objects.


    R�cCs||_||_||_dS(s�
        Construct a Float.

        :param precision: the numeric precision for use in DDL ``CREATE
           TABLE``.

        :param asdecimal: the same flag as that of :class:`.Numeric`, but
          defaults to ``False``.   Note that setting this flag to ``True``
          results in floating point conversion.

        :param decimal_return_scale: Default scale to use when converting
         from floats to Python decimals.  Floating point values will typically
         be much longer due to decimal inaccuracy, and most floating point
         database types don't have a notion of "scale", so by default the
         float type looks for the first ten decimal places when converting.
         Specifying this value will override that length.  Note that the
         MySQL float types, which do include "scale", will use "scale"
         as the default for decimal_return_scale, if not otherwise specified.

         .. versionadded:: 0.9.0

        N(R�R�R�(RR�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPs		cCs7|jrtjtj|j�S|jr/tjSdSdS(N(	R�RR�R�R�R�R�R�RI(RRWRi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm!s		N(	R+R,R.RwRIR�RzRPRm(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
	tDateTimecBsSeZdZdZed�Zd�Zd�Zed��Z	e
jd��ZRS(s�A type for ``datetime.datetime()`` objects.

    Date and time types return objects from the Python ``datetime``
    module.  Most DBAPIs have built in support for the datetime
    module, with the noted exception of SQLite.  In the case of
    SQLite, date and time types are stored as strings which are then
    converted back to datetime objects when rows are returned.

    For the time representation within the datetime type, some
    backends include additional options, such as timezone support and
    fractional seconds support.  For fractional seconds, use the
    dialect-specific datatype, such as :class:`.mysql.TIME`.  For
    timezone support, use at least the :class:`_types.TIMESTAMP` datatype,
    if not the dialect-specific datatype object.

    tdatetimecCs
||_dS(s�Construct a new :class:`.DateTime`.

        :param timezone: boolean.  Indicates that the datetime type should
         enable timezone support, if available on the
         **base date/time-holding type only**.   It is recommended
         to make use of the :class:`_types.TIMESTAMP` datatype directly when
         using this flag, as some databases include separate generic
         date/time-holding types distinct from the timezone-capable
         TIMESTAMP datatype, such as Oracle.


        N(ttimezone(RR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPAs
cCs|jS(N(tDATETIME(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRrPscCs+|jdk	}|r#|jr#tS|SdS(N(ttzinfoRIR�tDATETIME_TIMEZONE(RRVt
with_timezone((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_resolve_for_literalSscCstjS(N(tdtR�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRoZscCs3ii|jt6tj6i|jt6tt6tj6S(N(R�R�RR2R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR ^s(
R+R,R.RwRzRPRrR�R/RoRR�R (((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�,s		R�cBs>eZdZdZd�Zed��Zejd��Z	RS(s'A type for ``datetime.date()`` objects.tdatecCs|jS(N(R�(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRrpscCstjS(N(R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRosscCsOii|jt6tt6tt6tj6i|jt6tt6tt6tt6tj6S(N(	R�R�R�R�tTimeRR2R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR ws

(
R+R,R.RwRrR/RoRR�R (((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�js
	R�cBsSeZdZdZed�Zd�Zed��Zd�Z	e
jd��ZRS(s'A type for ``datetime.time()`` objects.ttimecCs
||_dS(N(R�(RR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�scCs|jS(N(R�(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRr�scCstjS(N(R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�scCs+|jdk	}|r#|jr#tS|SdS(N(R�RIR�t
TIME_TIMEZONE(RRVR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCs:iitt6|jt6tj6itt6|jt6tj6S(N(R�R�R�R�RR2R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR �s(
R+R,R.RwRzRPRrR/RoR�RR�R (((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s		t_BinarycBskeZdZd	d�Zd�Zed��Zd�Ze	j
rNd�Zn	d�Zd�Zd�Z
RS(
s&Define base behavior for binary types.cCs
||_dS(N(RK(RRK((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�scs�fd�}|S(Ncs&|j�j�jdd�}d|S(NRQs''s'%s'(tdecodeRcRS(RV(RW(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s((RRWRX((RWsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�scCstjS(N(RRZ(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�scs2|jdkrdS|jj��fd�}|S(Ncs|dk	r�|�SdSdS(N(RI(RV(tDBAPIBinary(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s
(RqRItBinary(RRWRX((R�sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s
cCstjS(N(Rtto_str(RRWRi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�scCs
d�}|S(NcSs|dk	rt|�}n|S(N(RItbytes(RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s((RRWRiRX((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�s	cCs3t|tj�r|Stt|�j||�SdS(s@See :meth:`.TypeEngine.coerce_compared_value` for a description.N(R3Rtstring_typesR7R�tcoerce_compared_value(RR&RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCs|jS(N(tBINARY(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRr�sN(R+R,R.RIRPRYR/RoRdRtpy2kRmR�Rr(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s					tLargeBinarycBs eZdZdZdd�ZRS(sA type for large binary byte data.

    The :class:`.LargeBinary` type corresponds to a large and/or unlengthed
    binary type for the target platform, such as BLOB on MySQL and BYTEA for
    PostgreSQL.  It also handles the necessary conversions for the DBAPI.

    tlarge_binarycCstj|d|�dS(s�
        Construct a LargeBinary type.

        :param length: optional, a length for the column for use in
          DDL statements, for those binary types that accept a length,
          such as the MySQL BLOB type.

        RKN(R�RP(RRK((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�s	N(R+R,R.RwRIRP(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��st
SchemaTypecBs�eZdZeZdddeded�Zd�Zd�Z	d�Z
d�Zd�Ze
d��Zded�Zded	�Zd
�Zd�Zd�Zd
�Zd�ZRS(sbMark a type as possibly requiring schema-level DDL for usage.

    Supports types that must be explicitly created/dropped (i.e. PG ENUM type)
    as well as types that are complimented by table or schema level
    constraints, triggers, and other rules.

    :class:`.SchemaType` classes can also be targets for the
    :meth:`.DDLEvents.before_parent_attach` and
    :meth:`.DDLEvents.after_parent_attach` events, where the events fire off
    surrounding the association of the type object with a parent
    :class:`_schema.Column`.

    .. seealso::

        :class:`.Enum`

        :class:`.Boolean`


    cCs�|dk	r!t||�|_n	d|_||_||_||_||_|r�|jr�tj|jdt	j
|j��tj|jdt	j
|j��ndS(Nt
before_createt
after_drop(
RIR	R�tschematmetadatatinherit_schemat_create_eventsRtlistenRtportable_instancemethodt_on_metadata_createt_on_metadata_drop(RR�R�R�R�tquoteR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP#s 						cKs|jtj|j��dS(N(t_on_table_attachRR�t
_set_table(Rtcolumntkw((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_set_parentAscCsAt|jt�r7|jjj�}|jj|d<nd}|S(Nt_default(R3R"RtmappingtcopytimplRI(RR�tvariant_mapping((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_variant_mapping_for_set_tableDs
cCs*|jr|j|_n6|jrN|jdkrN|jjrN|jj|_n|js[dS|j|�}tj|dtj	|j
i|d6��tj|dtj	|ji|d6��|jdkr&tj|jdtj	|ji|d6��tj|jdtj	|j
i|d6��ndS(NR�R�R�(R�R�R�RIR�R�RR�RR�t_on_table_createt_on_table_dropR�R�(RR�ttableR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�Ls<	$	cKs|j|jdt�S(NR�(tadaptR�R�(RR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�yscKsj|jd|j�}|jd|j�}|jdt�}|d|jd|d|jd|d||�S(NR�R�R�R�R�(tpopR�R�RzR�R�(RtimpltypeR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�|s		cCs|jr|jjpdS(N(R�tbindRI(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCsk|dkrt|�}n|j|j�}|j|jk	rgt|t�rg|jd|d|�ndS(s.Issue CREATE DDL for this type, if applicable.R�t
checkfirstN(RIRtdialect_implRWR�R3R�tcreate(RR�R�tt((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cCsk|dkrt|�}n|j|j�}|j|jk	rgt|t�rg|jd|d|�ndS(s,Issue DROP DDL for this type, if applicable.R�R�N(RIRR�RWR�R3R�tdrop(RR�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(t_is_impl_for_variantRWR�R�R3R�R�(RttargetR�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RWR�R�R3R�R�(RR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RWR�R�R3R�R�(RR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RWR�R�R3R�R�(RR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!csx|jdd�}|dkr"tS�fd�}|j|krW|||j�rWtS|j|krt||d�SdS(NR�cs(|�kp't|t�o'|j�kS(N(R3tARRAYt	item_type(ttyp(R(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_we_are_the_impl�sR�(R�RIR�R�(RRWR�R�R�((RsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sN(R+R,R.R�t_use_schema_mapRIRzRPR�R�R�R�R�R/R�R�R�R�R�R�R�R�(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�
s*			-		
						tEnumcBs#eZdZdZejdd�d��Zed��Zd�Z	d�Z
d	�Zed
��Zed��Z
d�Zd
ejfd��YZeZd�Zd�Zed�Zd�Zd�Zd�Zejd�d��Zd�Zd�Zd�Zd�Zed��ZRS(s7Generic Enum Type.

    The :class:`.Enum` type provides a set of possible string values
    which the column is constrained towards.

    The :class:`.Enum` type will make use of the backend's native "ENUM"
    type if one is available; otherwise, it uses a VARCHAR datatype.
    An option also exists to automatically produce a CHECK constraint
    when the VARCHAR (so called "non-native") variant is produced;
    see the  :paramref:`.Enum.create_constraint` flag.

    The :class:`.Enum` type also provides in-Python validation of string
    values during both read and write operations.  When reading a value
    from the database in a result set, the string value is always checked
    against the list of possible values and a ``LookupError`` is raised
    if no match is found.  When passing a value to the database as a
    plain string within a SQL statement, if the
    :paramref:`.Enum.validate_strings` parameter is
    set to True, a ``LookupError`` is raised for any string value that's
    not located in the given list of possible values; note that this
    impacts usage of LIKE expressions with enumerated values (an unusual
    use case).

    .. versionchanged:: 1.1 the :class:`.Enum` type now provides in-Python
       validation of input values as well as on data being returned by
       the database.

    The source of enumerated values may be a list of string values, or
    alternatively a PEP-435-compliant enumerated class.  For the purposes
    of the :class:`.Enum` datatype, this class need only provide a
    ``__members__`` method.

    When using an enumerated class, the enumerated objects are used
    both for input and output, rather than strings as is the case with
    a plain-string enumerated type::

        import enum
        from sqlalchemy import Enum

        class MyEnum(enum.Enum):
            one = 1
            two = 2
            three = 3

        t = Table(
            'data', MetaData(),
            Column('value', Enum(MyEnum))
        )

        connection.execute(t.insert(), {"value": MyEnum.two})
        assert connection.scalar(t.select()) is MyEnum.two

    Above, the string names of each element, e.g. "one", "two", "three",
    are persisted to the database; the values of the Python Enum, here
    indicated as integers, are **not** used; the value of each enum can
    therefore be any kind of Python object whether or not it is persistable.

    In order to persist the values and not the names, the
    :paramref:`.Enum.values_callable` parameter may be used.   The value of
    this parameter is a user-supplied callable, which  is intended to be used
    with a PEP-435-compliant enumerated class and  returns a list of string
    values to be persisted.   For a simple enumeration that uses string values,
    a callable such as  ``lambda x: [e.value for e in x]`` is sufficient.

    .. versionadded:: 1.1 - support for PEP-435-style enumerated
       classes.


    .. seealso::

        :class:`_postgresql.ENUM` - PostgreSQL-specific type,
        which has additional functionality.

        :class:`.mysql.ENUM` - MySQL-specific type

    tenumRFs1.3s�The :paramref:`.Enum.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.cOs|j||�dS(s2Construct an enum.

        Keyword arguments which don't apply to a specific backend are ignored
        by that backend.

        :param \*enums: either exactly one PEP-435 compliant enumerated type
           or one or more string labels.

           .. versionadded:: 1.1 a PEP-435 style enumerated class may be
              passed.

        :param convert_unicode: Enable unicode-aware bind parameter and
           result-set processing for this Enum's data under Python 2 only.
           Under Python 2, this is set automatically based on the presence of
           unicode label strings.  This flag will be removed in SQLAlchemy 2.0.

        :param create_constraint: defaults to False.  When creating a
           non-native enumerated type, also build a CHECK constraint on the
           database against the valid values.

           .. note:: it is strongly recommended that the CHECK constraint
              have an explicit name in order to support schema-management
              concerns.  This can be established either by setting the
              :paramref:`.Enum.name` parameter or by setting up an
              appropriate naming convention; see
              :ref:`constraint_naming_conventions` for background.

           .. versionchanged:: 1.4 - this flag now defaults to False, meaning
              no CHECK constraint is generated for a non-native enumerated
              type.

        :param metadata: Associate this type directly with a ``MetaData``
           object. For types that exist on the target database as an
           independent schema construct (PostgreSQL), this type will be
           created and dropped within ``create_all()`` and ``drop_all()``
           operations. If the type is not associated with any ``MetaData``
           object, it will associate itself with each ``Table`` in which it is
           used, and will be created when any of those individual tables are
           created, after a check is performed for its existence. The type is
           only dropped when ``drop_all()`` is called for that ``Table``
           object's metadata, however.

           The value of the :paramref:`_schema.MetaData.schema` parameter of
           the :class:`_schema.MetaData` object, if set, will be used as the
           default value of the :paramref:`_types.Enum.schema` on this object
           if an explicit value is not otherwise supplied.

           .. versionchanged:: 1.4.12 :class:`_types.Enum` inherits the
              :paramref:`_schema.MetaData.schema` parameter of the
              :class:`_schema.MetaData` object if present, when passed using
              the :paramref:`_types.Enum.metadata` parameter.

        :param name: The name of this type. This is required for PostgreSQL
           and any future supported database which requires an explicitly
           named type, or an explicitly named constraint in order to generate
           the type and/or a table that uses it. If a PEP-435 enumerated
           class was used, its name (converted to lower case) is used by
           default.

        :param native_enum: Use the database's native ENUM type when
           available. Defaults to True. When False, uses VARCHAR + check
           constraint for all backends. When False, the VARCHAR length can be
           controlled with :paramref:`.Enum.length`; currently "length" is
           ignored if native_enum=True.

        :param length: Allows specifying a custom length for the VARCHAR
           when :paramref:`.Enum.native_enum` is False. By default it uses the
           length of the longest value.

           .. versionadded:: 1.3.16

        :param schema: Schema name of this type. For types that exist on the
           target database as an independent schema construct (PostgreSQL),
           this parameter specifies the named schema in which the type is
           present.

           If not present, the schema name will be taken from the
           :class:`_schema.MetaData` collection if passed as
           :paramref:`_types.Enum.metadata`, for a :class:`_schema.MetaData`
           that includes the :paramref:`_schema.MetaData.schema` parameter.

           .. versionchanged:: 1.4.12 :class:`_types.Enum` inherits the
              :paramref:`_schema.MetaData.schema` parameter of the
              :class:`_schema.MetaData` object if present, when passed using
              the :paramref:`_types.Enum.metadata` parameter.

           Otherwise, if the :paramref:`_types.Enum.inherit_schema` flag is set
           to ``True``, the schema will be inherited from the associated
           :class:`_schema.Table` object if any; when
           :paramref:`_types.Enum.inherit_schema` is at its default of
           ``False``, the owning table's schema is **not** used.


        :param quote: Set explicit quoting preferences for the type's name.

        :param inherit_schema: When ``True``, the "schema" from the owning
           :class:`_schema.Table`
           will be copied to the "schema" attribute of this
           :class:`.Enum`, replacing whatever value was passed for the
           ``schema`` attribute.   This also takes effect when using the
           :meth:`_schema.Table.to_metadata` operation.

        :param validate_strings: when True, string values that are being
           passed to the database in a SQL statement will be checked
           for validity against the list of enumerated values.  Unrecognized
           values will result in a ``LookupError`` being raised.

           .. versionadded:: 1.1.0b2

        :param values_callable: A callable which will be passed the PEP-435
           compliant enumerated type, which should then return a list of string
           values to be persisted. This allows for alternate usages such as
           using the string value of an enum to be persisted to the database
           instead of its name.

           .. versionadded:: 1.2.3

        :param sort_key_function: a Python callable which may be used as the
           "key" argument in the Python ``sorted()`` built-in.   The SQLAlchemy
           ORM requires that primary key columns which are mapped must
           be sortable in some way.  When using an unsortable enumeration
           object such as a Python 3 ``Enum`` object, this parameter may be
           used to set a default sort key function for the objects.  By
           default, the database value of the enumeration is used as the
           sorting function.

           .. versionadded:: 1.3.8

        :param omit_aliases: A boolean that when true will remove aliases from
           pep 435 enums. For backward compatibility it defaults to ``False``.
           A deprecation warning is raised if the enum has aliases and this
           flag was not set.

           .. versionadded:: 1.4.5

           .. deprecated:: 1.4  The default will be changed to ``True`` in
              SQLAlchemy 2.0.

        N(t
_enum_init(RtenumsR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP#s�cCs$|jdk	r|jgS|jSdS(N(t
enum_classRIR�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_enums_argument�s
cCs�|jdt�|_|jdt�|_|jdd�|_|jdt�|_|jdt�}|jdt�|_	|jdt�}|j
||�\}}|j|||�|jdd�}|jd	t�|_|dkr$x<|j
D]"}t|tj�r�t}	Pq�q�Wt}	n|}	|j
rVtd
�|j
D��|_}
n
d|_}
|tk	r�|jr�|s�tjd�q�q�|r�||
kr�td
||
f��n|}
nd|jd<|jd<tt|�jd|
d|	�|jr%|jd|jjj��ntj|d|jdd�d|jdd�d|jdd�d|jdt�d|jdd�d|jdt��dS(s�internal init for :class:`.Enum` and subclasses.

        friendly init helper used by subclasses to remove
        all the Enum-specific keyword arguments from kw.  Allows all
        other arguments in kw to pass through.

        tnative_enumtcreate_constrainttvalues_callabletsort_key_functionRKtomit_aliasest_disable_warningsRFtvalidate_stringscss|]}t|�VqdS(N(tlen(t.0tx((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pys	<genexpr>�sis�Enum 'length' argument is currently ignored unless native_enum is specified as False, including for DDL that renders VARCHAR in any case.  This may change in a future release.s`When provided, length must be larger or equal than the length of the longest enum value. %s < %sRMR�R�R�R�R�R�N(R�R�R�RzR�RIR�Rt_sort_key_functiont
_omit_aliasest_parse_into_valuest_setup_for_valuesR�R�R3RR]tmaxt_default_lengthR�t
ValueErrort
_valid_lookupt_object_lookupR7R�RPR�R�R+tlowerR�(RR�R�t
length_argR�tvaluestobjectsRFteRMRK((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sX		#
	
	
	cCsh|r%d|kr%|jd�}nt|�dkrQt|dd�rQ|d|_|jj}g|j�D]!\}}|j|krp|^qp}|jtkr�|r�t	j
d|jj|f�n|jtkr�t
d�|j�D��}n|}|jr|j|j�}nt|�}g|D]}	||	^q1}
||
fSd|_||fSdS(Nt_enumsiit__members__s�The provided enum %s contains the aliases %s. The ``omit_aliases`` will default to ``True`` in SQLAlchemy 2.0. Specify a value to silence this warning.css0|]&\}}|j|kr||fVqdS(N(R�(R�tntv((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pys	<genexpr>s(R�R�thasattrR�R
titemsR�R�RRtwarn_deprecated_20R+R�RR�tlistRI(RR�R�t_membersRRtaliasestmembersRtkR((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s*%
4	
	cCs�t|�|_ttt|�t|���|_tt||��|_|jjg|D] }||j|j|f^q[�dS(N(RR�tdicttziptreversedRRtupdate(RRRR�RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�-s$	cCs!|jtkr|jS|jSdS(N(R�Rt_db_value_for_elem(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�;scCs|jS(N(R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytnativeBscCs~y|j|SWnhtk
ry}|jrAt|tj�rA|Stjtd||j	t
j|j�f�d|�nXdS(NsM'%s' is not among the defined enum values. Enum name: %s. Possible values: %streplace_context(
RtKeyErrorR�R3RR�Rtraise_tLookupErrorR�Rtrepr_tuple_namesR�(Rtelemterr((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRFs	
R!cBseZd�ZRS(cCs^ttj|�j||�\}}|tjkrTt|jjd|jj	�}n||fS(NRM(
R7R�R!R*RR5R@R"RKRM(RR&R'R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR*es(R+R,R*(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!dscCs^y|j|SWnHtk
rY}tjtd||jtj|j�f�d|�nXdS(NsM'%s' is not among the defined enum values. Enum name: %s. Possible values: %sR(	RRRRRR�RRR�(RR R!((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_object_value_for_elemqscCs=tj|ddtfdtfd|jfgdttg�S(Nt
additional_kwR�R�RKt
to_inspect(Rtgeneric_reprR�RzRR�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__repr__�s		cCsCt|d�r|j}ntd��tj||jdt|�S(NR�spTypeEngine.as_generic() heuristic is undefined for types that inherit Enum but do not have an `enums` attribute.R�(R
R�RRtconstructor_copyt_generic_type_affinityR�(Rtallow_nulltypetargs((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt
as_generic�s	cKs|jd|j�|jd|j�|jd|j�t|d<|jd|j�|jd|j�|jd|j�|jdt�|jd	|j	�|jd
|j
�|jd|j�|jd|j�|jd
|j
�d|ks�t�||�S(NRMR�R�R�R�R�R�R�R�R�R�RKR�R	(R�RMR�R�R�R�R�R�RzR�R�R�RKR�tAssertionError(RR�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytadapt_to_emulated�s
cKs0|j|d<t|d<tt|�j||�S(NR	R�(R�R�R7R�R�(RR�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s

cKs.|j|j|�stS|jp-|jjS(N(R�RWRzR�tsupports_native_enum(RtcompilerR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_should_create_constraint�sssqlalchemy.sql.schemac
Cs�tjj}tj|||�|js,dS|j|�}|jt|t	��j
|j�d|jdkrttn|jdtj|ji|d6�dt�}|j|ks�t�dS(NR�t_create_ruleR�t_type_bound(Rt	preloadedt
sql_schemaR�R�R�R�tCheckConstraintttype_coerceR@tin_R�R�RIRR�R0R�R�R,(RR�R�R�R�R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s		cs.tt��j|����fd�}|S(Ncs(�j|�}�r$�|�}n|S(N(R(RV(tparent_processorR(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s(R7R�RY(RRWRX((R8RsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�scs.tt��j|����fd�}|S(Ncs(�j|�}�r$�|�}n|S(N(R(RV(R8R(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s(R7R�Rd(RRWRX((R8RsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�scs1tt��j||����fd�}|S(Ncs(�r�|�}n�j|�}|S(N(R"(RV(R8R(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s(R7R�Rm(RRWRiRX((R8RsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�scKstj||�S(N(R�R�(RR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCs$|jr|jStt|�jSdS(N(R�R7R�Ro(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�s	(s1.3s�The :paramref:`.Enum.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.( R+R,R.RwRRyRPR/R�R�R�R�R�RRR@R!R0R"R&RzR+R-R�R0tpreload_moduleR�RYRdRmR�Ro(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s4L	�	J	"											t
PickleTypecBsVeZdZeZeZejdddd�Z
d�Zd�Zd�Z
d�ZRS(s�Holds Python objects, which are serialized using pickle.

    PickleType builds upon the Binary type to apply Python's
    ``pickle.dumps()`` to incoming objects, and ``pickle.loads()`` on
    the way out, allowing any pickleable Python object to be stored as
    a serialized binary field.

    To allow ORM change events to propagate for elements associated
    with :class:`.PickleType`, see :ref:`mutable_toplevel`.

    cCsP||_|pt|_||_tt|�j�|rLt|�|_ndS(s
        Construct a PickleType.

        :param protocol: defaults to ``pickle.HIGHEST_PROTOCOL``.

        :param pickler: defaults to cPickle.pickle or pickle.pickle if
          cPickle is not available.  May be any object with
          pickle-compatible ``dumps`` and ``loads`` methods.

        :param comparator: a 2-arg callable predicate used
          to compare values of this type.  If left as ``None``,
          the Python "equals" operator is used to compare values.

        :param impl: A binary-storing :class:`_types.TypeEngine` class or
          instance to use in place of the default :class:`_types.LargeBinary`.
          For example the :class: `_mysql.LONGBLOB` class may be more effective
          when using MySQL.

          .. versionadded:: 1.4.20

        N(	tprotocolRtpicklert
comparatorR7R:RPRR�(RR;R<R=R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP
s		cCst|jd|jffS(N(R:R;RIR=(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt
__reduce__.scs[|jj|��|jj�|j��rE���fd�}n��fd�}|S(Ncs(|dk	r�|��}n�|�S(N(RI(RV(tdumpstimpl_processorR;(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX7scs"|dk	r�|��}n|S(N(RI(RV(R?R;(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX>s(R�RdR<R?R;(RRWRX((R?R@R;sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd1s	csO|jj||��|jj��r<��fd�}n�fd�}|S(Ncs&�|�}|dkrdS�|�S(N(RI(RV(R@tloads(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXJscs|dkrdS�|�S(N(RI(RV(RA(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXRs(R�RmR<RA(RRWRiRX((R@RAsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRmEscCs'|jr|j||�S||kSdS(N(R=(RR�ty((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytcompare_valuesYs	N(R+R,R.R�R�R�tcache_okRtHIGHEST_PROTOCOLRIRPR>RdRmRC(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR:�s			tBooleancBs�eZdZdZeZeded�Zd�Z	e
jd�d��Ze
d��Zedeeg�Zd�Zd�Zd	�Zd
�ZRS(s�A bool datatype.

    :class:`.Boolean` typically uses BOOLEAN or SMALLINT on the DDL side,
    and on the Python side deals in ``True`` or ``False``.

    The :class:`.Boolean` datatype currently has two levels of assertion
    that the values persisted are simple true/false values.  For all
    backends, only the Python values ``None``, ``True``, ``False``, ``1``
    or ``0`` are accepted as parameter values.   For those backends that
    don't support a "native boolean" datatype, an option exists to
    also create a CHECK constraint on the target column

    .. versionchanged:: 1.2 the :class:`.Boolean` datatype now asserts that
       incoming Python values are already in pure boolean form.


    tbooleancCs||_||_||_dS(s�Construct a Boolean.

        :param create_constraint: defaults to False.  If the boolean
          is generated as an int/smallint, also create a CHECK constraint
          on the table that ensures 1 or 0 as a value.

          .. note:: it is strongly recommended that the CHECK constraint
             have an explicit name in order to support schema-management
             concerns.  This can be established either by setting the
             :paramref:`.Boolean.name` parameter or by setting up an
             appropriate naming convention; see
             :ref:`constraint_naming_conventions` for background.

          .. versionchanged:: 1.4 - this flag now defaults to False, meaning
             no CHECK constraint is generated for a non-native enumerated
             type.

        :param name: if a CHECK constraint is generated, specify
          the name of the constraint.

        N(R�R�R�(RR�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPws		cKs0|j|j|�stS|jjo/|jjS(N(R�RWRztsupports_native_booleant#non_native_boolean_check_constraint(RR/R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR0�s
ssqlalchemy.sql.schemac
Cs�tjj}|jsdS|j|�}|jt||�jddg�d|jdkrat
n|jdtj|ji|d6�dt
�}|j|ks�t�dS(NiiR�R1R�R2(RR3R4R�R�R5R6R7R�RIRR�R0R�R�R,(RR�R�R�R�R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s		cCstS(N(tbool(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�scCsN||jkrJt|t�s4td|f��qJtd|f��n|S(NsNot a boolean value: %rs$Value %r is not None, True, or False(t
_strict_boolsR3R�t	TypeErrorR(RRV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_strict_as_bool�scsI|j|d�}|jd��|jd�����fd�}|S(Ncs�j|�r�S�S(N(RM(RV(tfalseRttrue(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s(tstatement_compilerRIt
visit_truetvisit_false(RRWR/RX((RNRROsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�s
cs7|j�|jrt�nt���fd�}|S(Ncs+�|�}|dk	r'�|�}n|S(N(RI(RV(t_coerceRM(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�s(RMRHRJR�(RRWRX((RSRMsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s			cCs|jr
dStjSdS(N(RHRIRtint_to_boolean(RRWRi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�s	N(R+R,R.RwR�RRzRIRPR0RR9R�R/Rot	frozensetRKRMRYRdRm(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF`s		
	
	t_AbstractIntervalcBs2eZejd��Zed��Zd�ZRS(cCs}iitt6|jt6tt6tt6tj6i|jt6tj6i|jt6tj	6i|jt6tj
6i|jt6tj6S(N(R�R�R�R�R�RR2R�R�R�R�R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR �s
cCstS(N(R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR#�scCs|jj||�S(s@See :meth:`.TypeEngine.coerce_compared_value` for a description.(R�R�(RR&RV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s(R+R,RR�R R/R#R�(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRV�sR�cBs�eZdZeZejr0ejj	d�Z
n'ejjdejj
�jdd�Z
eZeddd�Zed��Zd�Zd�Zd�ZRS(	s�A type for ``datetime.timedelta()`` objects.

    The Interval type deals with ``datetime.timedelta`` objects.  In
    PostgreSQL, the native ``INTERVAL`` type is used; for others, the
    value is stored as a date which is relative to the "epoch"
    (Jan. 1, 1970).

    Note that the ``Interval`` type does not currently provide date arithmetic
    operations on platforms which do not support interval types natively. Such
    operations usually require transformation of both sides of the expression
    (such as, conversion of both sides into integer epoch values first) which
    currently is a manual procedure (such as via
    :attr:`~sqlalchemy.sql.expression.func`).

    iR�cCs2tt|�j�||_||_||_dS(s;Construct an Interval object.

        :param native: when True, use the actual
          INTERVAL type provided by the database, if
          supported (currently PostgreSQL, Oracle).
          Otherwise, represent the interval data as
          an epoch value regardless.

        :param second_precision: For native interval types
          which support a "fractional seconds precision" parameter,
          i.e. Oracle and PostgreSQL

        :param day_precision: for native interval types which
          support a "day precision" parameter, i.e. Oracle.

        N(R7R�RPRtsecond_precisiont
day_precision(RRRWRX((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPs		cCstjS(N(R�t	timedelta(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo+scKstj|||�S(N(RVR�(RR�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR-/scsI|jj|��|j��r6��fd�}n�fd�}|S(Ncs#|dk	r�|}n�|�S(N(RI(RV(tepochR@(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX7s
cs|dk	r�|}n|S(N(RI(RV(RZ(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX>s
(R�RdRZ(RRWRX((RZR@sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd2s	csL|jj||��|j��r9��fd�}n�fd�}|S(Ncs$�|�}|dkrdS|�S(N(RI(RV(RZR@(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXJscs|dkrdS|�S(N(RI(RV(RZ(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXRs(R�RmRZ(RRWRiRX((RZR@sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRmEs	N(R+R,R.R�R�RR�R�R�tutcfromtimestampRZt
fromtimestampR�tutcRSRIR�RDRPR/RoR-RdRm(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s				tJSONcBseZdZdZeZejd�Zed�Z	de
fd��YZdefd��YZdefd	��YZ
d
efd��YZdefd
��YZdejejfd��YZeZed��Zed��Zejd��Zejd��Zd�Zd�ZRS(s�Represent a SQL JSON type.

    .. note::  :class:`_types.JSON`
       is provided as a facade for vendor-specific
       JSON types.  Since it supports JSON SQL operations, it only
       works on backends that have an actual JSON type, currently:

       * PostgreSQL - see :class:`sqlalchemy.dialects.postgresql.JSON` and
         :class:`sqlalchemy.dialects.postgresql.JSONB` for backend-specific
         notes

       * MySQL - see
         :class:`sqlalchemy.dialects.mysql.JSON` for backend-specific notes

       * SQLite as of version 3.9 - see
         :class:`sqlalchemy.dialects.sqlite.JSON` for backend-specific notes

       * Microsoft SQL Server 2016 and later - see
         :class:`sqlalchemy.dialects.mssql.JSON` for backend-specific notes

    :class:`_types.JSON` is part of the Core in support of the growing
    popularity of native JSON datatypes.

    The :class:`_types.JSON` type stores arbitrary JSON format data, e.g.::

        data_table = Table('data_table', metadata,
            Column('id', Integer, primary_key=True),
            Column('data', JSON)
        )

        with engine.connect() as conn:
            conn.execute(
                data_table.insert(),
                {"data": {"key1": "value1", "key2": "value2"}}
            )

    **JSON-Specific Expression Operators**

    The :class:`_types.JSON`
    datatype provides these additional SQL operations:

    * Keyed index operations::

        data_table.c.data['some key']

    * Integer index operations::

        data_table.c.data[3]

    * Path index operations::

        data_table.c.data[('key_1', 'key_2', 5, ..., 'key_n')]

    * Data casters for specific JSON element types, subsequent to an index
      or path operation being invoked::

        data_table.c.data["some key"].as_integer()

      .. versionadded:: 1.3.11

    Additional operations may be available from the dialect-specific versions
    of :class:`_types.JSON`, such as
    :class:`sqlalchemy.dialects.postgresql.JSON` and
    :class:`sqlalchemy.dialects.postgresql.JSONB` which both offer additional
    PostgreSQL-specific operations.

    **Casting JSON Elements to Other Types**

    Index operations, i.e. those invoked by calling upon the expression using
    the Python bracket operator as in ``some_column['some key']``, return an
    expression object whose type defaults to :class:`_types.JSON` by default,
    so that
    further JSON-oriented instructions may be called upon the result type.
    However, it is likely more common that an index operation is expected
    to return a specific scalar element, such as a string or integer.  In
    order to provide access to these elements in a backend-agnostic way,
    a series of data casters are provided:

    * :meth:`.JSON.Comparator.as_string` - return the element as a string

    * :meth:`.JSON.Comparator.as_boolean` - return the element as a boolean

    * :meth:`.JSON.Comparator.as_float` - return the element as a float

    * :meth:`.JSON.Comparator.as_integer` - return the element as an integer

    These data casters are implemented by supporting dialects in order to
    assure that comparisons to the above types will work as expected, such as::

        # integer comparison
        data_table.c.data["some_integer_key"].as_integer() == 5

        # boolean comparison
        data_table.c.data["some_boolean"].as_boolean() == True

    .. versionadded:: 1.3.11 Added type-specific casters for the basic JSON
       data element types.

    .. note::

        The data caster functions are new in version 1.3.11, and supersede
        the previous documented approaches of using CAST; for reference,
        this looked like::

           from sqlalchemy import cast, type_coerce
           from sqlalchemy import String, JSON
           cast(
               data_table.c.data['some_key'], String
           ) == type_coerce(55, JSON)

        The above case now works directly as::

            data_table.c.data['some_key'].as_integer() == 5

        For details on the previous comparison approach within the 1.3.x
        series, see the documentation for SQLAlchemy 1.2 or the included HTML
        files in the doc/ directory of the version's distribution.

    **Detecting Changes in JSON columns when using the ORM**

    The :class:`_types.JSON` type, when used with the SQLAlchemy ORM, does not
    detect in-place mutations to the structure.  In order to detect these, the
    :mod:`sqlalchemy.ext.mutable` extension must be used, most typically
    using the :class:`.MutableDict` class.  This extension will
    allow "in-place" changes to the datastructure to produce events which
    will be detected by the unit of work.  See the example at :class:`.HSTORE`
    for a simple example involving a dictionary.

    Alternatively, assigning a JSON structure to an ORM element that
    replaces the old one will always trigger a change event.

    **Support for JSON null vs. SQL NULL**

    When working with NULL values, the :class:`_types.JSON` type recommends the
    use of two specific constants in order to differentiate between a column
    that evaluates to SQL NULL, e.g. no value, vs. the JSON-encoded string of
    ``"null"``. To insert or select against a value that is SQL NULL, use the
    constant :func:`.null`. This symbol may be passed as a parameter value
    specifically when using the :class:`_types.JSON` datatype, which contains
    special logic that interprets this symbol to mean that the column value
    should be SQL NULL as opposed to JSON ``"null"``::

        from sqlalchemy import null
        conn.execute(table.insert(), {"json_value": null()})

    To insert or select against a value that is JSON ``"null"``, use the
    constant :attr:`_types.JSON.NULL`::

        conn.execute(table.insert(), {"json_value": JSON.NULL})

    The :class:`_types.JSON` type supports a flag
    :paramref:`_types.JSON.none_as_null` which when set to True will result
    in the Python constant ``None`` evaluating to the value of SQL
    NULL, and when set to False results in the Python constant
    ``None`` evaluating to the value of JSON ``"null"``.    The Python
    value ``None`` may be used in conjunction with either
    :attr:`_types.JSON.NULL` and :func:`.null` in order to indicate NULL
    values, but care must be taken as to the value of the
    :paramref:`_types.JSON.none_as_null` in these cases.

    **Customizing the JSON Serializer**

    The JSON serializer and deserializer used by :class:`_types.JSON`
    defaults to
    Python's ``json.dumps`` and ``json.loads`` functions; in the case of the
    psycopg2 dialect, psycopg2 may be using its own custom loader function.

    In order to affect the serializer / deserializer, they are currently
    configurable at the :func:`_sa.create_engine` level via the
    :paramref:`_sa.create_engine.json_serializer` and
    :paramref:`_sa.create_engine.json_deserializer` parameters.  For example,
    to turn off ``ensure_ascii``::

        engine = create_engine(
            "sqlite://",
            json_serializer=lambda obj: json.dumps(obj, ensure_ascii=False))

    .. versionchanged:: 1.3.7

        SQLite dialect's ``json_serializer`` and ``json_deserializer``
        parameters renamed from ``_json_serializer`` and
        ``_json_deserializer``.

    .. seealso::

        :class:`sqlalchemy.dialects.postgresql.JSON`

        :class:`sqlalchemy.dialects.postgresql.JSONB`

        :class:`sqlalchemy.dialects.mysql.JSON`

        :class:`sqlalchemy.dialects.sqlite.JSON`

    .. versionadded:: 1.1


    R^t	JSON_NULLcCs
||_dS(s�Construct a :class:`_types.JSON` type.

        :param none_as_null=False: if True, persist the value ``None`` as a
         SQL NULL value, not the JSON encoding of ``null``. Note that when this
         flag is False, the :func:`.null` construct can still be used to
         persist a NULL value, which may be passed directly as a parameter
         value that is specially interpreted by the :class:`_types.JSON` type
         as SQL NULL::

             from sqlalchemy import null
             conn.execute(table.insert(), {"data": null()})

         .. note::

              :paramref:`_types.JSON.none_as_null` does **not** apply to the
              values passed to :paramref:`_schema.Column.default` and
              :paramref:`_schema.Column.server_default`; a value of ``None``
              passed for these parameters means "no default present".

              Additionally, when used in SQL comparison expressions, the
              Python value ``None`` continues to refer to SQL null, and not
              JSON NULL.  The :paramref:`_types.JSON.none_as_null` flag refers
              explicitly to the **persistence** of the value within an
              INSERT or UPDATE statement.   The :attr:`_types.JSON.NULL`
              value should be used for SQL expressions that wish to compare to
              JSON null.

         .. seealso::

              :attr:`.types.JSON.NULL`

        N(tnone_as_null(RR`((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRPP	s!tJSONElementTypecBsDeZdZe�Ze�Zd�Zd�Zd�Z	d�Z
RS(s?Common function for index / path elements in a JSON expression.cCs|jj|�S(N(t_stringt_cached_bind_processor(RRW((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytstring_bind_processory	scCs|jj|�S(N(Rbt_cached_literal_processor(RRW((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytstring_literal_processor|	scs7|jj|��|j|����fd�}|S(NcsO�r$t|t�r$�|�}n'�rKt|tj�rK�|�}n|S(N(R3R�RR�(RV(t
int_processortstring_processor(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�	s
(t_integerRcRd(RRWRX((RgRhsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd	scs7|jj|��|j|����fd�}|S(NcsO�r$t|t�r$�|�}n'�rKt|tj�rK�|�}n|S(N(R3R�RR�(RV(RgRh(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRX�	s
(RiReRf(RRWRX((RgRhsH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�	s(R+R,R.R�RiR@RbRdRfRdRY(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRas	s					
t
JSONIndexTypecBseZdZRS(s�Placeholder for the datatype of a JSON index value.

        This allows execution-time processing of JSON index values
        for special syntaxes.

        (R+R,R.(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRj�	stJSONIntIndexTypecBseZdZRS(s�Placeholder for the datatype of a JSON index value.

        This allows execution-time processing of JSON index values
        for special syntaxes.

        (R+R,R.(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRk�	stJSONStrIndexTypecBseZdZRS(s�Placeholder for the datatype of a JSON index value.

        This allows execution-time processing of JSON index values
        for special syntaxes.

        (R+R,R.(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRl�	stJSONPathTypecBseZdZRS(s�Placeholder type for JSON path operations.

        This allows execution-time processing of a path-based
        index value into a specific SQL syntax.

        (R+R,R.(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�	sR!cBsYeZdZd�Zd�Zd�Zd�Zd�Zed�Z	d�Z
d�ZRS(	s6Define comparison operations for :class:`_types.JSON`.cCs�t|tj�rdt|tjj�rdtjtj	|d|j
dtjdt
j�}tj}nQtjtj	|d|j
dtjdt|t�r�t
jnt
j�}tj}|||jfS(NR6toperatortbindparam_type(R3RR�Rtcollections_abctSequenceRtexpectRtBinaryElementRoleR6Rtjson_path_getitem_opR^Rmtjson_getitem_opR�RkRlR"(RR9Rn((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR:�	s$					cCs|jt�d�S(sDCast an indexed value as boolean.

            e.g.::

                stmt = select(
                    mytable.c.json_column['some_data'].as_boolean()
                ).where(
                    mytable.c.json_column['some_data'].as_boolean() == True
                )

            .. versionadded:: 1.3.11

            t
as_boolean(t_binary_w_typeRF(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRv�	scCs|jt�d�S(s^Cast an indexed value as string.

            e.g.::

                stmt = select(
                    mytable.c.json_column['some_data'].as_string()
                ).where(
                    mytable.c.json_column['some_data'].as_string() ==
                    'some string'
                )

            .. versionadded:: 1.3.11

            t	as_string(RwR@(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRx�	scCs|jt�d�S(sACast an indexed value as integer.

            e.g.::

                stmt = select(
                    mytable.c.json_column['some_data'].as_integer()
                ).where(
                    mytable.c.json_column['some_data'].as_integer() == 5
                )

            .. versionadded:: 1.3.11

            t
as_integer(RwR�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRy�	scCs|jt�d�S(s?Cast an indexed value as float.

            e.g.::

                stmt = select(
                    mytable.c.json_column['some_data'].as_float()
                ).where(
                    mytable.c.json_column['some_data'].as_float() == 29.75
                )

            .. versionadded:: 1.3.11

            tas_float(RwR�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRz
scCs|jt||d|�d�S(smCast an indexed value as numeric/decimal.

            e.g.::

                stmt = select(
                    mytable.c.json_column['some_data'].as_numeric(10, 6)
                ).where(
                    mytable.c.
                    json_column['some_data'].as_numeric(10, 6) == 29.75
                )

            .. versionadded:: 1.4.0b2

            R�t
as_numeric(RwR�(RR�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR{
scCs|jS(s�Cast an indexed value as JSON.

            e.g.::

                stmt = select(mytable.c.json_column['some_data'].as_json())

            This is typically the default behavior of indexed elements in any
            case.

            Note that comparison of full JSON structures may not be
            supported by all backends.

            .. versionadded:: 1.3.11

            (R6(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytas_json+
scCslt|jtj�s4|jjtjtjfkrPtj	d||f��n|jj
�}||_|S(Ns[The JSON cast operator JSON.%s() only works with a JSON index expression e.g. col['q'].%s()(R3R6RtBinaryExpressionRnRRuRtRtInvalidRequestErrort_cloneR"(RR�tmethod_nameR6((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRw=
s		(R+R,R.R:RvRxRyRzR�R{R|Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!�	s						cCstS(N(R(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRoO
scCs|jS(s)Alias of :attr:`_types.JSON.none_as_null`(R`(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytshould_evaluate_noneS
scCs||_dS(N(R`(RRV((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�X
scCs
tdt�S(NRM(R@R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt	_str_impl\
scs=�jj|��|jp!tj����fd�}|S(Ncsh|�jkrd}n+t|tj�s?|dkrC�jrCdS�|�}�rd�|�}n|S(N(tNULLRIR3RtNullR`(RVt
serialized(tjson_serializerRtstring_process(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXe
s	(R�Rdt_json_serializertjsonR?(RRWRX((R�RR�sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd`
s
cs=|jj||��|jp$tj���fd�}|S(Ncs/|dkrdS�r%�|�}n�|�S(N(RI(RV(tjson_deserializerR�(sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRXx
s
(R�Rmt_json_deserializerR�RA(RRWRiRX((R�R�sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRmt
s(R+R,R.RwRzthashableRRxR�RPRRaRjRkRlRmR8R!R1R0R/RoR�tsetterR�R�RdRm(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR^Zs$�,#&�	R�cBs�eZdZdZeZeZdej	e
j	fd��YZ	e	Zed
ed�Z
ed��Zed��Zd�Zed�Zd	�ZRS(sRepresent a SQL Array type.

    .. note::  This type serves as the basis for all ARRAY operations.
       However, currently **only the PostgreSQL backend has support for SQL
       arrays in SQLAlchemy**. It is recommended to use the PostgreSQL-specific
       :class:`sqlalchemy.dialects.postgresql.ARRAY` type directly when using
       ARRAY types with PostgreSQL, as it provides additional operators
       specific to that backend.

    :class:`_types.ARRAY` is part of the Core in support of various SQL
    standard functions such as :class:`_functions.array_agg`
    which explicitly involve
    arrays; however, with the exception of the PostgreSQL backend and possibly
    some third-party dialects, no other SQLAlchemy built-in dialect has support
    for this type.

    An :class:`_types.ARRAY` type is constructed given the "type"
    of element::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer))
            )

    The above type represents an N-dimensional array,
    meaning a supporting backend such as PostgreSQL will interpret values
    with any number of dimensions automatically.   To produce an INSERT
    construct that passes in a 1-dimensional array of integers::

        connection.execute(
                mytable.insert(),
                {"data": [1,2,3]}
        )

    The :class:`_types.ARRAY` type can be constructed given a fixed number
    of dimensions::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer, dimensions=2))
            )

    Sending a number of dimensions is optional, but recommended if the
    datatype is to represent arrays of more than one dimension.  This number
    is used:

    * When emitting the type declaration itself to the database, e.g.
      ``INTEGER[][]``

    * When translating Python values to database values, and vice versa, e.g.
      an ARRAY of :class:`.Unicode` objects uses this number to efficiently
      access the string values inside of array structures without resorting
      to per-row type inspection

    * When used with the Python ``getitem`` accessor, the number of dimensions
      serves to define the kind of type that the ``[]`` operator should
      return, e.g. for an ARRAY of INTEGER with two dimensions::

          >>> expr = table.c.column[5]  # returns ARRAY(Integer, dimensions=1)
          >>> expr = expr[6]  # returns Integer

    For 1-dimensional arrays, an :class:`_types.ARRAY` instance with no
    dimension parameter will generally assume single-dimensional behaviors.

    SQL expressions of type :class:`_types.ARRAY` have support for "index" and
    "slice" behavior.  The Python ``[]`` operator works normally here, given
    integer indexes or slices.  Arrays default to 1-based indexing.
    The operator produces binary expression
    constructs which will produce the appropriate SQL, both for
    SELECT statements::

        select(mytable.c.data[5], mytable.c.data[2:7])

    as well as UPDATE statements when the :meth:`_expression.Update.values`
    method
    is used::

        mytable.update().values({
            mytable.c.data[5]: 7,
            mytable.c.data[2:7]: [1, 2, 3]
        })

    The :class:`_types.ARRAY` type also provides for the operators
    :meth:`.types.ARRAY.Comparator.any` and
    :meth:`.types.ARRAY.Comparator.all`. The PostgreSQL-specific version of
    :class:`_types.ARRAY` also provides additional operators.

    .. container:: topic

        **Detecting Changes in ARRAY columns when using the ORM**

        The :class:`_sqltypes.ARRAY` type, when used with the SQLAlchemy ORM,
        does not detect in-place mutations to the array. In order to detect
        these, the :mod:`sqlalchemy.ext.mutable` extension must be used, using
        the :class:`.MutableList` class::

            from sqlalchemy import ARRAY
            from sqlalchemy.ext.mutable import MutableList

            class SomeOrmClass(Base):
                # ...

                data = Column(MutableList.as_mutable(ARRAY(Integer)))

        This extension will allow "in-place" changes such to the array
        such as ``.append()`` to produce events which will be detected by the
        unit of work.  Note that changes to elements **inside** the array,
        including subarrays that are mutated in place, are **not** detected.

        Alternatively, assigning a new array value to an ORM element that
        replaces the old one will always trigger a change event.

    .. versionadded:: 1.1.0

    .. seealso::

        :class:`sqlalchemy.dialects.postgresql.ARRAY`

    R�R!cBsVeZdZd�Zd�Zejd�dd��Zejd�dd��Z	RS(s�Define comparison operations for :class:`_types.ARRAY`.

        More operators are available on the dialect-specific form
        of this type.  See :class:`.postgresql.ARRAY.Comparator`.

        cCst|t�r�|j}|jjrJt|jd|jd|j�}nt|j|j|jd|jj	�}t
j||fS|jjr�|d7}n|jjdks�|jjdkr�|jj}n2i|jjdd6}|jj|jj|�}t
j||fSdS(Nit_namet
dimensions(R3tsliceR"tzero_indexeststarttstoptstepR
R6tkeyRtgetitemR�RIR�R�R�(RR9treturn_typetslice_tadapt_kw((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR:
s	&$
$	cOstd��dS(s�``ARRAY.contains()`` not implemented for the base ARRAY type.
            Use the dialect-specific ARRAY type.

            .. seealso::

                :class:`_postgresql.ARRAY` - PostgreSQL specific version.
            sdARRAY.contains() not implemented for the base ARRAY type; please use the dialect-specific ARRAY typeN(R(RtargR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytcontains sssqlalchemy.sql.elementscCsvtjj}|r|ntj}|j}|jtjt	j
d|d|d|jd|j�|j
j|j�|�S(sSReturn ``other operator ANY (array)`` clause.

            .. note:: This method is an :class:`_types.ARRAY` - specific
                construct that is now superseded by the :func:`_sql.any_`
                function, which features a different calling style. The
                :func:`_sql.any_` function is also mirrored at the method level
                via the :meth:`_sql.ColumnOperators.any_` method.

            Usage of array-specific :meth:`_types.ARRAY.Comparator.any`
            is as follows::

                from sqlalchemy.sql import operators

                conn.execute(
                    select(table.c.data).where(
                            table.c.data.any(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :func:`_expression.any_`

                :meth:`.types.ARRAY.Comparator.all`

            telementRnR6Ro(RR3tsql_elementsRteqR"R}RRrRRsR6R�tCollectionAggregatet_create_any(RtotherRnRtarr_type((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytany-s!				cCsvtjj}|r|ntj}|j}|jtjt	j
d|d|d|jd|j�|j
j|j�|�S(sSReturn ``other operator ALL (array)`` clause.

            .. note:: This method is an :class:`_types.ARRAY` - specific
                construct that is now superseded by the :func:`_sql.any_`
                function, which features a different calling style. The
                :func:`_sql.any_` function is also mirrored at the method level
                via the :meth:`_sql.ColumnOperators.any_` method.

            Usage of array-specific :meth:`_types.ARRAY.Comparator.all`
            is as follows::

                from sqlalchemy.sql import operators

                conn.execute(
                    select(table.c.data).where(
                            table.c.data.all(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :func:`_expression.all_`

                :meth:`.types.ARRAY.Comparator.any`

            R�RnR6Ro(RR3R�RR�R"R}RRrRRsR6R�R�t_create_all(RR�RnRR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytallas!				N(
R+R,R.R:R�RR9RIR�R�(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!s		
3cCsat|t�rtd��nt|t�r9|�}n||_||_||_||_dS(s�Construct an :class:`_types.ARRAY`.

        E.g.::

          Column('myarray', ARRAY(Integer))

        Arguments are:

        :param item_type: The data type of items of this array. Note that
          dimensionality is irrelevant here, so multi-dimensional arrays like
          ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
          ``ARRAY(ARRAY(Integer))`` or such.

        :param as_tuple=False: Specify whether return results
          should be converted to tuples from lists.  This parameter is
          not generally needed as a Python list corresponds well
          to a SQL array.

        :param dimensions: if non-None, the ARRAY will assume a fixed
         number of dimensions.   This impacts how the array is declared
         on the database, how it goes about interpreting Python and
         result values, as well as how expression behavior in conjunction
         with the "getitem" operator works.  See the description at
         :class:`_types.ARRAY` for additional detail.

        :param zero_indexes=False: when True, index values will be converted
         between Python zero-based and SQL one-based indexes, e.g.
         a value of one will be added to all index values before passing
         to the database.

        sUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN(R3R�RR"R�tas_tupleR�R�(RR�R�R�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�s"			cCs|jS(N(R�(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCstS(N(R(R((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRo�scCs
||kS(N((RR�RB((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRC�scKs3|r/t|jt�r/|jj||�ndS(sSupport SchemaEventTargetN(R3R�RR�(RR�touterR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCsEtt|�j|dt�t|jt�rA|jj|�ndS(sSupport SchemaEventTargetR�N(R7R�t_set_parent_with_dispatchR�R3R�R(Rtparent((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sN(R+R,R.RwR�t	_is_arrayRzR�R8R!R1R0RIRPR/R�RoRCR�R�(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
su�-	t	TupleTypecBs/eZdZeZd�Zd�Zd�ZRS(s(represent the composite type of a Tuple.cGsGt|k|_g|D]$}t|t�r4|�n|^q|_dS(N(tNULLTYPEt_fully_typedR3R"ttypes(RR�R�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�scCsX|jr
|Stgt|j|�D]*\}}|tkrGt|�n|^q#�SdS(N(R�R�RR�R�t_resolve_value_to_type(RRVR�R ((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_resolve_values_to_types�s
	cCstd��dS(NsJThe tuple type does not support being fetched as a column in a result row.(R(RRWRi((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRm�s(R+R,R.R�t_is_tuple_typeRPR�Rm(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
		tREALcBseZdZdZRS(sThe SQL REAL type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��stFLOATcBseZdZdZRS(sThe SQL FLOAT type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�stNUMERICcBseZdZdZRS(sThe SQL NUMERIC type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�stDECIMALcBseZdZdZRS(sThe SQL DECIMAL type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�stINTEGERcBseZdZdZRS(sThe SQL INT or INTEGER type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�stSMALLINTcBseZdZdZRS(sThe SQL SMALLINT type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�#stBIGINTcBseZdZdZRS(sThe SQL BIGINT type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�*st	TIMESTAMPcBs)eZdZdZed�Zd�ZRS(sThe SQL TIMESTAMP type.

    :class:`_types.TIMESTAMP` datatypes have support for timezone
    storage on some backends, such as PostgreSQL and Oracle.  Use the
    :paramref:`~types.TIMESTAMP.timezone` argument in order to enable
    "TIMESTAMP WITH TIMEZONE" for these backends.

    R�cCstt|�jd|�dS(smConstruct a new :class:`_types.TIMESTAMP`.

        :param timezone: boolean.  Indicates that the TIMESTAMP type should
         enable timezone support, if available on the target database.
         On a per-dialect basis is similar to "TIMESTAMP WITH TIMEZONE".
         If the target database does not support timezones, this flag is
         ignored.


        R�N(R7R�RP(RR�((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP>scCs|jS(N(R�(RRq((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRrKs(R+R,R.RwRzRPRr(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�1s	
R�cBseZdZdZRS(sThe SQL DATETIME type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�OstDATEcBseZdZdZRS(sThe SQL DATE type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�VstTIMEcBseZdZdZRS(sThe SQL TIME type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�]stTEXTcBseZdZdZRS(sThe SQL TEXT type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�dstCLOBcBseZdZdZRS(sCThe CLOB type.

    This type is found in Oracle and Informix.
    R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�kstVARCHARcBseZdZdZRS(sThe SQL VARCHAR type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�ustNVARCHARcBseZdZdZRS(sThe SQL NVARCHAR type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�|stCHARcBseZdZdZRS(sThe SQL CHAR type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��stNCHARcBseZdZdZRS(sThe SQL NCHAR type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��stBLOBcBseZdZdZRS(sThe SQL BLOB type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sR�cBseZdZdZRS(sThe SQL BINARY type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��st	VARBINARYcBseZdZdZRS(sThe SQL VARBINARY type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��stBOOLEANcBseZdZdZRS(sThe SQL BOOLEAN type.R�(R+R,R.Rw(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sR4cBsBeZdZdZeZd�Zdejfd��YZeZ	RS(sAn unknown type.

    :class:`.NullType` is used as a default type for those cases where
    a type cannot be determined, including:

    * During table reflection, when the type of a column is not recognized
      by the :class:`.Dialect`
    * When constructing SQL expressions using plain Python objects of
      unknown types (e.g. ``somecolumn == my_special_object``)
    * When a new :class:`_schema.Column` is created,
      and the given type is passed
      as ``None`` or is not passed at all.

    The :class:`.NullType` can be used within SQL expression invocation
    without issue, it just has no behavior either at the expression
    construction level or at the bind-parameter/result processing level.
    :class:`.NullType` will result in a :exc:`.CompileError` if the compiler
    is asked to render the type itself, such as if it is used in a
    :func:`.cast` operation or within a schema creation operation such as that
    invoked by :meth:`_schema.MetaData.create_all` or the
    :class:`.CreateTable`
    construct.

    tnullcCsdS(N(RI(RRW((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�sR!cBseZd�ZRS(cCsFt|tj�s"tj|�r2||jjfS|j||�SdS(N(R3R4R!Rtis_commutativeR6R"R*(RR&R'((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR*�s
(R+R,R*(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR!�s(
R+R,R.RwR�t_isnullRYRR!R0(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR4�s		tTableValueTypecBs/eZdZeZdejfgZd�ZRS(sRefers to a table value type.t	_elementscGs/g|D]}tjtj|�^q|_dS(N(RRrRtStrAsPlainColumnRoleR�(RRR ((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRP�s(	R+R,R.R�t_is_table_valueR
tdp_clauseelement_listt_traverse_internalsRP(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��st	MatchTypecBseZdZRS(sDRefers to the return type of the MATCH operator.

    As the :meth:`.ColumnOperators.match` is probably the most open-ended
    operator in generic SQLAlchemy Core, we can't assume the return type
    at SQL evaluation time, as MySQL returns a floating point, not a boolean,
    and other backends might do something different.    So this type
    acts as a placeholder, currently subclassing :class:`.Boolean`.
    The type allows dialects to inject result-processing functionality
    if needed, and on MySQL will return floating-point values.

    .. versionadded:: 1.0.0

    (R+R,R.(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
R�cCstt|�t�}|tkrntj|t�}|dk	rj|jtjkrjtj	d|f��nt
S|j|�SdS(Ns-Object %r is not legal as a SQL literal value(t
_type_map_getR"RzRtinspectRIR�t_registrarsRRJR�R�(RVt_result_typetinsp((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�
s(wR.RaR�R�R�R�tRRRRRtbaseRRRRR	R
RR6t
traversalsRR
RRRRRRRRRRRRRRRtobjectRR1R8R@R|R~R�R�R�R�R�R�R�R�R�R�R�R�R�R:RFRVR�R^R�R�R�R�R�R�R�tINTR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R4R�R�R�tBOOLEANTYPEt
STRINGTYPEtINTEGERTYPEtNUMERICTYPEt	MATCHTYPEt
TABLEVALUER�R�R�R�R�RJR�R�R�RYtNoneTypet	_type_maptpy3kR�RnRR$R�R�t	INDEXABLER!(((sH/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt<module>
s��F (�7>&"@���)f~`��*�^
.