MCPcopy Create free account
hub / github.com/pybind/pybind11 / cast

Function cast

include/pybind11/stl/filesystem.h:52–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51public:
52 static handle cast(const T &path, return_value_policy, handle) {
53 if (auto py_str = unicode_from_fs_native(path.native())) {
54 return module_::import("pathlib")
55 .attr("Path")(reinterpret_steal<object>(py_str))
56 .release();
57 }
58 return nullptr;
59 }
60
61 bool load(handle handle, bool) {
62 // PyUnicode_FSConverter and PyUnicode_FSDecoder normally take care of

Callers

nothing calls this directly

Calls 4

unicode_from_fs_nativeFunction · 0.85
importFunction · 0.85
releaseMethod · 0.80
attrMethod · 0.80

Tested by

no test coverage detected