Skip to content

Commit

Permalink
Fix Typo in types.md (#4416)
Browse files Browse the repository at this point in the history
Fixes a typo in `types.md` regarding the use of the `Bound<'py, T>` smart pointer.
  • Loading branch information
akuhnregnier authored Aug 3, 2024
1 parent 319a497 commit 3bf2f1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guide/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The lack of binding to the `'py` lifetime also carries drawbacks:
- Almost all methods on `Py<T>` require a `Python<'py>` token as the first argument
- Other functionality, such as [`Drop`][Drop], needs to check at runtime for attachment to the Python GIL, at a small performance cost

Because of the drawbacks `Bound<'py, T>` is preferred for many of PyO3's APIs. In particular, `Bound<'py, T>` is the better for function arguments.
Because of the drawbacks `Bound<'py, T>` is preferred for many of PyO3's APIs. In particular, `Bound<'py, T>` is better for function arguments.

To convert a `Py<T>` into a `Bound<'py, T>`, the `Py::bind` and `Py::into_bound` methods are available. `Bound<'py, T>` can be converted back into `Py<T>` using [`Bound::unbind`].

Expand Down

0 comments on commit 3bf2f1f

Please sign in to comment.