| 100 | } |
| 101 | |
| 102 | inline bool object_is_convertible_to_std_set(const handle &src, bool convert) { |
| 103 | // Allow set/frozenset and dict keys. |
| 104 | // In convert mode: also allow types derived from collections.abc.Set. |
| 105 | return ((PyAnySet_Check(src.ptr()) != 0) |
| 106 | || object_is_instance_with_one_of_tp_names(src.ptr(), {"dict_keys"})) |
| 107 | || (convert && isinstance(src, module_::import("collections.abc").attr("Set"))); |
| 108 | } |
| 109 | |
| 110 | inline bool object_is_convertible_to_std_map(const handle &src, bool convert) { |
| 111 | // Allow dict. |
no test coverage detected