Python::attach(|py| {
    let obj = self.inner.bind(py);
    py.import("contextvars")
        .and_then(|m| m.call_method0("copy_context"))
        .and_then(|ctx| {
            let bound_method = obj.getattr("{{ method_name }}")?;
            ctx.call_method1("run", ({{ run_args }}))
        })
{% if native_return_binding %}
        .and_then(|v| {
            // Native fast-path: the host returned the binding's result object — extract it and
            // convert via `From<{{ native_return_binding }}>`, skipping the JSON round-trip. Fall back
            // to the mapping path (a JSON string) when the host returned a plain mapping instead.
            if let Ok(native) = v.extract::<{{ native_return_binding }}>() {
                return Ok(<{{ extract_ty }}>::from(native));
            }
            let s = v.extract::<String>()?;
            serde_json::from_str::<{{ extract_ty }}>(&s).map_err(|e| {{ deserialize_error_expr }})
        })
{% elif is_named %}
        .and_then(|v| v.extract::<String>())
        .and_then(|s| serde_json::from_str::<{{ extract_ty }}>(&s).map_err(|e| {{ deserialize_error_expr }}))
{% else %}
        .and_then(|v| v.extract::<{{ extract_ty }}>())
{% endif %}
{% if has_error %}
        .map_err(|e| {{ error_expr }})
{% else %}
        .unwrap_or_default()
{% endif %}
})
