From 7460dc0ce782b74a3727375e6c06276237d4e725 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 10 Jun 2024 19:05:51 -0700 Subject: [PATCH] Revert "Add return value policy _clif_automatic (#4343)" This reverts commit 6d3a0fc319cc03ba7b5e242e76e697626670340e. --- include/pybind11/detail/common.h | 11 +---------- include/pybind11/detail/smart_holder_type_casters.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 55e25f3fc..6223a71ab 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -554,16 +554,7 @@ enum class return_value_policy : uint8_t { but the purpose of _return_as_bytes is certain to be orthogonal, because C++ strings are always copied to Python `bytes` or `str`. NOTE: This policy is NOT available on master. */ - _return_as_bytes, - - /** This policy should only be used by PyCLIF to automatically select a - return value policy. Legacy PyCLIF automatically decides object lifetime - management based on their properties: - https://github.com/google/clif/tree/main/clif/python#pointers-references-and-object-ownership - With this policy, the return value policy selection is consistent with - legacy PyCLIF. - NOTE: This policy is NOT available on master. */ - _clif_automatic + _return_as_bytes }; #define PYBIND11_HAS_RETURN_VALUE_POLICY_RETURN_AS_BYTES diff --git a/include/pybind11/detail/smart_holder_type_casters.h b/include/pybind11/detail/smart_holder_type_casters.h index 3ab11cf8a..55a2b5a0d 100644 --- a/include/pybind11/detail/smart_holder_type_casters.h +++ b/include/pybind11/detail/smart_holder_type_casters.h @@ -918,7 +918,6 @@ struct smart_holder_type_caster> : smart_holder_type_caster_l break; case return_value_policy::reference_internal: case return_value_policy::_return_as_bytes: - case return_value_policy::_clif_automatic: break; } if (!src) {