Skip to content

Commit

Permalink
Revert "Add return value policy _clif_automatic (#4343)"
Browse files Browse the repository at this point in the history
This reverts commit 6d3a0fc.
  • Loading branch information
Ralf W. Grosse-Kunstleve authored and rwgk committed Jun 11, 2024
1 parent 7a945d8 commit 7460dc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
11 changes: 1 addition & 10 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion include/pybind11/detail/smart_holder_type_casters.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,6 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : 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) {
Expand Down

0 comments on commit 7460dc0

Please sign in to comment.