def METHOD_NAME(op, ptype=None):
    op_type = op.type
    if op_type.is_int:
        # Make sure that integer literals always have exactly the type that the templates expect.
        return op_type.cast_code(op.result())
    if is_type(op_type, ["is_pythran_expr", "is_numeric", "is_float", "is_complex"]):
        return op.result()
    if op.is_none:
        return "pythonic::%s::None" % pythran_builtins
    if ptype is None:
        ptype = pythran_type(op_type)
    assert op.type.is_pyobject
    return "from_python<%s>(%s)" % (ptype, op.py_result())