Skip to content

Commit

Permalink
Merge pull request #3272 from lucatrv/patch-2
Browse files Browse the repository at this point in the history
Add conversions between Rust Path/PathBuf and Python str / pathlib.Path
  • Loading branch information
davidhewitt authored Jun 26, 2023
2 parents 7425206 + de9d760 commit 76b794a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion guide/src/conversions/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The table below contains the Python type and the corresponding function argument
| Python | Rust | Rust (Python-native) |
| ------------- |:-------------------------------:|:--------------------:|
| `object` | - | `&PyAny` |
| `str` | `String`, `Cow<str>`, `&str`, `OsString`, `PathBuf` | `&PyUnicode` |
| `str` | `String`, `Cow<str>`, `&str`, `OsString`, `PathBuf`, `Path` | `&PyString`, `&PyUnicode` |
| `bytes` | `Vec<u8>`, `&[u8]`, `Cow<[u8]>` | `&PyBytes` |
| `bool` | `bool` | `&PyBool` |
| `int` | Any integer type (`i32`, `u32`, `usize`, etc) | `&PyLong` |
Expand All @@ -28,6 +28,7 @@ The table below contains the Python type and the corresponding function argument
| `slice` | - | `&PySlice` |
| `type` | - | `&PyType` |
| `module` | - | `&PyModule` |
| `pathlib.Path` | `PathBuf`, `Path` | `&PyString`, `&PyUnicode` |
| `datetime.datetime` | - | `&PyDateTime` |
| `datetime.date` | - | `&PyDate` |
| `datetime.time` | - | `&PyTime` |
Expand Down

0 comments on commit 76b794a

Please sign in to comment.