'Convert this :class:`.JSONElement` to apply both the \'astext\' operator
as well as an explicit type cast when evaulated.
E.g.::
select([data_table.c.data[\'some key\'].cast(Integer)])
.. seealso::
:attr:`.JSONElement.astext`'

def cast(self, type_):

    if (not self._astext):
        return self.astext.cast(type_)
    else:
        return sql.cast(self, type_)
