Skip to content

Commit

Permalink
fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Oct 21, 2024
1 parent c167b34 commit 66f09b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions guide/src/free-threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The most straightforward way to trigger this problem to use the Python
`pyclass`. For example, consider the following `PyClass` implementation:

```
# use python::prelude::*;
# use pyo3::prelude::*;
# fn main() {
#[pyclass]
#[derive(Default)]
Expand All @@ -119,12 +119,13 @@ impl ThreadIter {
self.count += 1;
self.count
}
}
# }
```

And then if we do something like this in Python:

```
```python
import concurrent.futures
from my_module import ThreadIter

Expand All @@ -140,7 +141,7 @@ with concurrent.futures.ThreadPoolExecutor(max_workers=16) as tpe:

We will see an exception:

```
```text
Traceback (most recent call last)
File "example.py", line 5, in <module>
next(i)
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ pub mod doc_test {
"guide/src/exception.md" => guide_exception_md,
"guide/src/faq.md" => guide_faq_md,
"guide/src/features.md" => guide_features_md,
"guide/src/free-threading.md" => guide_free_threading_md,
"guide/src/function.md" => guide_function_md,
"guide/src/function/error-handling.md" => guide_function_error_handling_md,
"guide/src/function/signature.md" => guide_function_signature_md,
Expand Down

0 comments on commit 66f09b8

Please sign in to comment.