diff --git a/guide/src/conversions/tables.md b/guide/src/conversions/tables.md index 6baf7dca677..517be091de8 100644 --- a/guide/src/conversions/tables.md +++ b/guide/src/conversions/tables.md @@ -14,7 +14,7 @@ The table below contains the Python type and the corresponding function argument | ------------- |:-------------------------------:|:--------------------:| | `object` | - | `&PyAny` | | `str` | `String`, `Cow`, `&str`, `OsString`, `PathBuf` | `&PyUnicode` | -| `bytes` | `Vec`, `&[u8]` | `&PyBytes` | +| `bytes` | `Vec`, `&[u8]`, `Cow<[u8]>` | `&PyBytes` | | `bool` | `bool` | `&PyBool` | | `int` | Any integer type (`i32`, `u32`, `usize`, etc) | `&PyLong` | | `float` | `f32`, `f64` | `&PyFloat` | @@ -24,7 +24,7 @@ The table below contains the Python type and the corresponding function argument | `tuple[T, U]` | `(T, U)`, `Vec` | `&PyTuple` | | `set[T]` | `HashSet`, `BTreeSet`, `hashbrown::HashSet`[^2] | `&PySet` | | `frozenset[T]` | `HashSet`, `BTreeSet`, `hashbrown::HashSet`[^2] | `&PyFrozenSet` | -| `bytearray` | `Vec` | `&PyByteArray` | +| `bytearray` | `Vec`, `Cow<[u8]>` | `&PyByteArray` | | `slice` | - | `&PySlice` | | `type` | - | `&PyType` | | `module` | - | `&PyModule` | @@ -84,6 +84,7 @@ Finally, the following Rust types are also able to convert to Python as return v | `Option` | `Optional[T]` | | `(T, U)` | `Tuple[T, U]` | | `Vec` | `List[T]` | +| `Cow<[u8]>` | `bytes | bytearray` | | `HashMap` | `Dict[K, V]` | | `BTreeMap` | `Dict[K, V]` | | `HashSet` | `Set[T]` |