parameters: (typingctx, val, typ)
return_statement: return sig, codegen
docstring: Cast *val* to *typ*
docstring_summary: Cast *val* to *typ*
docstring_tokens: Cast * val * to * typ *
function: def _cast(typingctx, val, typ):
      """Cast *val* to *typ*
      """
      def codegen(context, builder, signature, args):
          [val, typ] = args
          context.nrt.incref(builder, signature.return_type, val)
          return val
      # Using implicit casting in argument types
      casted = typ.instance_type
      _sentry_safe_cast(val, casted)
      sig = casted(casted, typ)
      return sig, codegen
function_tokens: def _cast ( typingctx , val , typ ) : def codegen ( context , builder , signature , args ) : [ val , typ ] = args context . nrt . incref ( builder , signature . return_type , val ) return val # Using implicit casting in argument types casted = typ . instance_type _sentry_safe_cast ( val , casted ) sig = casted ( casted , typ ) return sig , codegen