parameters: (self, expression, type_)
docstring: r"""Produce a ``CAST`` expression.
  
          :func:`.cast` returns an instance of :class:`.Cast`.
  
          E.g.::
  
              from sqlalchemy import cast, Numeric
  
              stmt = select([
                          cast(product_table.c.unit_price, Numeric(10, 4))
                      ])
  
          The above statement will produce SQL resembling::
  
              SELECT CAST(unit_price AS NUMERIC(10, 4)) FROM product
  
          The :func:`.cast` function performs two distinct functions when
          used.  The first is that it renders the ``CAST`` expression within
          the resulting SQL string.  The second is that it associates the given
          type (e.g. :class:`.TypeEngine` class or instance) with the column
          expression on the Python side, which means the expression will take
          on the expression operator behavior associated with that type,
          as well as the bound-value handling and result-row-handling behavior
          of the type.
  
          .. versionchanged:: 0.9.0 :func:`.cast` now applies the given type
             to the expression such that it takes effect on the bound-value,
             e.g. the Python-to-database direction, in addition to the
             result handling, e.g. database-to-Python, direction.
  
          An alternative to :func:`.cast` is the :func:`.type_coerce` function.
          This function performs the second task of associating an expression
          with a specific type, but does not render the ``CAST`` expression
          in SQL.
  
          :param expression: A SQL expression, such as a :class:`.ColumnElement`
           expression or a Python string which will be coerced into a bound
           literal value.
  
          :param type\_: A :class:`.TypeEngine` class or instance indicating
           the type to which the ``CAST`` should apply.
  
          .. seealso::
  
              :ref:`coretutorial_casts`
  
              :func:`.type_coerce` - an alternative to CAST that coerces the type
              on the Python side only, which is often sufficient to generate the
              correct SQL and data coercion.
docstring_summary: r"""Produce a ``CAST`` expression.
docstring_tokens: r Produce a CAST expression .
function: def __init__(self, expression, type_):
          r"""Produce a ``CAST`` expression.
  
          :func:`.cast` returns an instance of :class:`.Cast`.
  
          E.g.::
  
              from sqlalchemy import cast, Numeric
  
              stmt = select([
                          cast(product_table.c.unit_price, Numeric(10, 4))
                      ])
  
          The above statement will produce SQL resembling::
  
              SELECT CAST(unit_price AS NUMERIC(10, 4)) FROM product
  
          The :func:`.cast` function performs two distinct functions when
          used.  The first is that it renders the ``CAST`` expression within
          the resulting SQL string.  The second is that it associates the given
          type (e.g. :class:`.TypeEngine` class or instance) with the column
          expression on the Python side, which means the expression will take
          on the expression operator behavior associated with that type,
          as well as the bound-value handling and result-row-handling behavior
          of the type.
  
          .. versionchanged:: 0.9.0 :func:`.cast` now applies the given type
             to the expression such that it takes effect on the bound-value,
             e.g. the Python-to-database direction, in addition to the
             result handling, e.g. database-to-Python, direction.
  
          An alternative to :func:`.cast` is the :func:`.type_coerce` function.
          This function performs the second task of associating an expression
          with a specific type, but does not render the ``CAST`` expression
          in SQL.
  
          :param expression: A SQL expression, such as a :class:`.ColumnElement`
           expression or a Python string which will be coerced into a bound
           literal value.
  
          :param type\_: A :class:`.TypeEngine` class or instance indicating
           the type to which the ``CAST`` should apply.
  
          .. seealso::
  
              :ref:`coretutorial_casts`
  
              :func:`.type_coerce` - an alternative to CAST that coerces the type
              on the Python side only, which is often sufficient to generate the
              correct SQL and data coercion.
  
  
          """
          self.type = type_api.to_instance(type_)
          self.clause = coercions.expect(
              roles.ExpressionElementRole, expression, type_=self.type
          )
          self.typeclause = TypeClause(self.type)
function_tokens: def __init__ ( self , expression , type_ ) : self . type = type_api . to_instance ( type_ ) self . clause = coercions . expect ( roles . ExpressionElementRole , expression , type_ = self . type ) self . typeclause = TypeClause ( self . type )