| 24 | /////////////////////////////////////////////////////////////////////////////// |
| 25 | |
| 26 | bool is_str_or_path(nb::object obj) { |
| 27 | if (nb::isinstance<nb::str>(obj)) { |
| 28 | return true; |
| 29 | } |
| 30 | nb::object path_type = nb::module_::import_("pathlib").attr("Path"); |
| 31 | return nb::isinstance(obj, path_type); |
| 32 | } |
| 33 | |
| 34 | bool is_istream_object(const nb::object& file) { |
| 35 | return nb::hasattr(file, "readinto") && nb::hasattr(file, "seek") && |
no outgoing calls
no test coverage detected