File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -478,7 +478,16 @@ enum class return_value_policy : uint8_t {
478
478
but the purpose of _return_as_bytes is certain to be orthogonal, because
479
479
C++ strings are always copied to Python `bytes` or `str`.
480
480
NOTE: This policy is NOT available on master. */
481
- _return_as_bytes
481
+ _return_as_bytes,
482
+
483
+ /* * This policy should only be used by PyCLIF to automatically select a
484
+ return value policy. Legacy PyCLIF automatically decides object lifetime
485
+ management based on their properties:
486
+ https://github.com/google/clif/tree/main/clif/python#pointers-references-and-object-ownership
487
+ With this policy, the return value policy selection is consistent with
488
+ legacy PyCLIF.
489
+ NOTE: This policy is NOT available on master. */
490
+ _clif_automatic
482
491
};
483
492
484
493
PYBIND11_NAMESPACE_BEGIN (detail)
Original file line number Diff line number Diff line change @@ -795,6 +795,7 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
795
795
break ;
796
796
case return_value_policy::reference_internal:
797
797
case return_value_policy::_return_as_bytes:
798
+ case return_value_policy::_clif_automatic:
798
799
break ;
799
800
}
800
801
if (!src) {
You can’t perform that action at this time.
0 commit comments