Skip to content

Commit eb3fac9

Browse files
jessekrubindavidhewitt
authored andcommitted
fix: typos in guide/docs (#5182)
1 parent 7601c0c commit eb3fac9

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

guide/src/class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ enum HttpResponse {
5555
}
5656

5757
// PyO3 also supports enums with Struct and Tuple variants
58-
// These complex enums have sligtly different behavior from the simple enums above
58+
// These complex enums have slightly different behavior from the simple enums above
5959
// They are meant to work with instance checks and match statement patterns
6060
// The variants can be mixed and matched
6161
// Struct variants have named fields while tuple enums generate generic names for fields in order _0, _1, _2, ...
@@ -825,7 +825,7 @@ impl MyClass {
825825

826826
## Classes as function arguments
827827

828-
Free functions defined using `#[pyfunction]` interact with classes through the same mechanisms as the self parameters of instance methods, i.e. they can take GIL-bound references, GIL-bound reference wrappers or GIL-indepedent references:
828+
Free functions defined using `#[pyfunction]` interact with classes through the same mechanisms as the self parameters of instance methods, i.e. they can take GIL-bound references, GIL-bound reference wrappers or GIL-independent references:
829829

830830
```rust,no_run
831831
# #![allow(dead_code)]
@@ -857,7 +857,7 @@ fn increment_then_print_field(my_class: &Bound<'_, MyClass>) {
857857
println!("{}", my_class.borrow().my_field);
858858
}
859859
860-
// Take a GIL-indepedent reference when you want to store the reference elsewhere.
860+
// Take a GIL-independent reference when you want to store the reference elsewhere.
861861
#[pyfunction]
862862
fn print_refcnt(my_class: Py<MyClass>, py: Python<'_>) {
863863
println!("{}", my_class.get_refcnt(py));

guide/src/conversions/traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ Additionally `IntoPyObject` can be derived for a reference to a struct or enum u
613613
##### `#[derive(IntoPyObject)]`/`#[derive(IntoPyObjectRef)]` Field Attributes
614614
- `pyo3(into_py_with = ...)`
615615
- apply a custom function to convert the field from Rust into Python.
616-
- the argument must be the function indentifier
616+
- the argument must be the function identifier
617617
- the function signature must be `fn(Cow<'_, T>, Python<'py>) -> PyResult<Bound<'py, PyAny>>` where `T` is the Rust type of the argument.
618618
- `#[derive(IntoPyObject)]` will invoke the function with `Cow::Owned`
619619
- `#[derive(IntoPyObjectRef)]` will invoke the function with `Cow::Borrowed`
@@ -650,7 +650,7 @@ struct MyPyObjectWrapper(PyObject);
650650
impl<'py> IntoPyObject<'py> for MyPyObjectWrapper {
651651
type Target = PyAny; // the Python type
652652
type Output = Bound<'py, Self::Target>; // in most cases this will be `Bound`
653-
type Error = std::convert::Infallible; // the conversion error type, has to be convertable to `PyErr`
653+
type Error = std::convert::Infallible; // the conversion error type, has to be convertible to `PyErr`
654654
655655
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
656656
Ok(self.0.into_bound(py))

guide/src/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ For more information about how to use both `lldb` and `gdb` you can read the [gd
6868
6969
### Debugger specific setup
7070

71-
Depeding on your OS and your preferences you can use two different debuggers, `rust-gdb` or `rust-lldb`.
71+
Depending on your OS and your preferences you can use two different debuggers, `rust-gdb` or `rust-lldb`.
7272

7373
{{#tabs }}
7474
{{#tab name="Using rust-gdb" }}

guide/src/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This feature was introduced to ease migration. It was found that delayed referen
7777

7878
### `pyo3_disable_reference_pool`
7979

80-
This is a performance-oriented conditional compilation flag, e.g. [set via `$RUSTFLAGS`][set-configuration-options], which disabled the global reference pool and the assocaited overhead for the crossing the Python-Rust boundary. However, if enabled, `Drop`ping an instance of `Py<T>` without the GIL being held will abort the process.
80+
This is a performance-oriented conditional compilation flag, e.g. [set via `$RUSTFLAGS`][set-configuration-options], which disabled the global reference pool and the associated overhead for the crossing the Python-Rust boundary. However, if enabled, `Drop`ping an instance of `Py<T>` without the GIL being held will abort the process.
8181

8282
### `macros`
8383

guide/src/free-threading.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ GIL-enabled build instead ask the interpreter to attach the thread to the Python
148148
runtime, and there can be many threads simultaneously attached. See [PEP
149149
703](https://peps.python.org/pep-0703/#thread-states) for more background about
150150
how threads can be attached and detached from the interpreter runtime, in a
151-
manner analagous to releasing and acquiring the GIL in the GIL-enabled build.
151+
manner analogous to releasing and acquiring the GIL in the GIL-enabled build.
152152

153153
In the GIL-enabled build, PyO3 uses the [`Python<'py>`] type and the `'py`
154154
lifetime to signify that the global interpreter lock is held. In the
@@ -289,7 +289,7 @@ GIL-enabled build.
289289

290290
If, for example, the function executed by [`GILOnceCell`] releases the GIL or
291291
calls code that releases the GIL, then it is possible for multiple threads to
292-
race to initialize the cell. While the cell will only ever be intialized
292+
race to initialize the cell. While the cell will only ever be initialized
293293
once, it can be problematic in some contexts that [`GILOnceCell`] does not block
294294
like the standard library [`OnceLock`].
295295

guide/src/migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl PyClassAsyncIter {
645645
<details>
646646
<summary><small>Click to expand</small></summary>
647647

648-
Interactions with Python objects implemented in Rust no longer need to go though `PyCell<T>`. Instead iteractions with Python object now consistently go through `Bound<T>` or `Py<T>` independently of whether `T` is native Python object or a `#[pyclass]` implemented in Rust. Use `Bound::new` or `Py::new` respectively to create and `Bound::borrow(_mut)` / `Py::borrow(_mut)` to borrow the Rust object.
648+
Interactions with Python objects implemented in Rust no longer need to go though `PyCell<T>`. Instead interactions with Python object now consistently go through `Bound<T>` or `Py<T>` independently of whether `T` is native Python object or a `#[pyclass]` implemented in Rust. Use `Bound::new` or `Py::new` respectively to create and `Bound::borrow(_mut)` / `Py::borrow(_mut)` to borrow the Rust object.
649649
</details>
650650

651651
### Migrating from the GIL Refs API to `Bound<T>`
@@ -657,7 +657,7 @@ To minimise breakage of code using the GIL Refs API, the `Bound<T>` smart pointe
657657
To identify what to migrate, temporarily switch off the `gil-refs` feature to see deprecation warnings on [almost](#cases-where-pyo3-cannot-emit-gil-ref-deprecation-warnings) all uses of APIs accepting and producing GIL Refs . Over one or more PRs it should be possible to follow the deprecation hints to update code. Depending on your development environment, switching off the `gil-refs` feature may introduce [some very targeted breakages](#deactivating-the-gil-refs-feature), so you may need to fixup those first.
658658

659659
For example, the following APIs have gained updated variants:
660-
- `PyList::new`, `PyTyple::new` and similar constructors have replacements `PyList::new_bound`, `PyTuple::new_bound` etc.
660+
- `PyList::new`, `PyTuple::new` and similar constructors have replacements `PyList::new_bound`, `PyTuple::new_bound` etc.
661661
- `FromPyObject::extract` has a new `FromPyObject::extract_bound` (see the section below)
662662
- The `PyTypeInfo` trait has had new `_bound` methods added to accept / return `Bound<T>`.
663663

@@ -1082,7 +1082,7 @@ impl Object {
10821082
}
10831083
}
10841084
1085-
// It either forces us to release the GIL before aquiring it again.
1085+
// It either forces us to release the GIL before acquiring it again.
10861086
let first = Python::with_gil(|py| Object::new(py));
10871087
let second = Python::with_gil(|py| Object::new(py));
10881088
drop(first);

0 commit comments

Comments
 (0)