Is there a way to expose a PathBuf
struct member as a Python's pathlib.Path
member?
#3474
Unanswered
AngheloAlf
asked this question in
Questions
Replies: 1 comment 3 replies
-
You could write a custom |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm porting a Python library to PyO3 and everything is working fine, up until testing this Python class to Rust:
Python:
Rust:
For some reason the Rusts version converts the
filepath
member to astr
instead of apathlib.Path
when accessing it from Python, which feels a bit inconsistent since thenew
method takes aPathBuf
and making a Python instance errors if I don't pass apathlib.Path
.Am I doing something wrong?
I'm using PyO3 0.19.0
Beta Was this translation helpful? Give feedback.
All reactions