You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/src/building-and-distribution.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,7 +247,8 @@ See [the relevant section of this guide](./building-and-distribution/multiple-py
247
247
PyO3 is only able to link your extension module to abi3 version up to and including your host Python version.
248
248
E.g., if you set `abi3-py38` and try to compile the crate with a host of Python 3.7, the build will fail.
249
249
250
-
> Note: If you set more that one of these `abi3` version feature flags the lowest version always wins. For example, with both `abi3-py37` and `abi3-py38` set, PyO3 would build a wheel which supports Python 3.7 and up.
250
+
> [!NOTE]
251
+
> If you set more that one of these `abi3` version feature flags the lowest version always wins. For example, with both `abi3-py37` and `abi3-py38` set, PyO3 would build a wheel which supports Python 3.7 and up.
251
252
252
253
#### Building `abi3` extensions without a Python interpreter
Copy file name to clipboardExpand all lines: guide/src/class/protocols.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,8 +84,10 @@ The given signatures should be interpreted as follows:
84
84
The implementations of Python's "rich comparison" operators `<`, `<=`, `==`, `!=`, `>` and `>=` respectively.
85
85
86
86
_Note that implementing any of these methods will cause Python not to generate a default `__hash__` implementation, so consider also implementing `__hash__`._
87
+
87
88
<details>
88
89
<summary>Return type</summary>
90
+
89
91
The return type will normally be `bool` or `PyResult<bool>`, however any Python object can be returned.
90
92
</details>
91
93
@@ -100,6 +102,7 @@ The given signatures should be interpreted as follows:
100
102
_Note that implementing `__richcmp__` will cause Python not to generate a default `__hash__` implementation, so consider implementing `__hash__` when implementing `__richcmp__`._
101
103
<details>
102
104
<summary>Return type</summary>
105
+
103
106
The return type will normally be `PyResult<bool>`, but any Python object can be returned.
104
107
105
108
If you want to leave some operations unimplemented, you can return `py.NotImplemented()`
@@ -135,7 +138,8 @@ The given signatures should be interpreted as follows:
135
138
- `__getattribute__(<self>, object) -> object`
136
139
137
140
<details>
138
-
<summary>Differences between `__getattr__` and `__getattribute__`</summary>
141
+
<summary>Differences between <code>__getattr__</code> and <code>__getattribute__</code></summary>
142
+
139
143
As in Python, `__getattr__` is only called if the attribute is not found
140
144
by normal attribute lookup. `__getattribute__`, on the other hand, is
141
145
called for *every* attribute access. If it wants to access existing
@@ -440,7 +444,8 @@ Immutable references do not have to be cleared, as every cycle must contain at l
> Note: `__traverse__` does not work with [`#[pyo3(warn(...))]`](../function.md#warn).
447
+
> [!NOTE]
448
+
> `__traverse__` does not work with [`#[pyo3(warn(...))]`](../function.md#warn).
444
449
445
450
Example:
446
451
@@ -471,7 +476,8 @@ impl ClassWithGCSupport {
471
476
Usually, an implementation of `__traverse__` should do nothing but calls to `visit.call`.
472
477
Most importantly, safe access to the interpreter is prohibited inside implementations of `__traverse__`, i.e. `Python::attach` will panic.
473
478
474
-
> Note: these methods are part of the C API, PyPy does not necessarily honor them. If you are building for PyPy you should measure memory consumption to make sure you do not have runaway memory growth. See [this issue on the PyPy bug tracker](https://github.com/pypy/pypy/issues/3848).
479
+
> [!NOTE]
480
+
> These methods are part of the C API, PyPy does not necessarily honor them. If you are building for PyPy you should measure memory consumption to make sure you do not have runaway memory growth. See [this issue on the PyPy bug tracker](https://github.com/pypy/pypy/issues/3848).
> Note: to use keywords like `struct` as a function argument, use "raw identifier" syntax `r#struct` in both the signature and the function definition:
117
+
> [!NOTE]
118
+
> To use keywords like `struct` as a function argument, use "raw identifier" syntax `r#struct` in both the signature and the function definition:
0 commit comments