Update docs now that recursive `#[classattr]` are allowed again
This commit is contained in:
parent
f49478619f
commit
f5e1dff7eb
|
@ -31,7 +31,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
|
||||
### Removed
|
||||
- Remove `ManagedPyRef` (unused, and needs specialization) [#930](https://github.com/PyO3/pyo3/pull/930)
|
||||
- Disable `#[classattr]` where the class attribute is the same type as the class. (This may be re-enabled in the future; the previous implemenation was unsound.) [#975](https://github.com/PyO3/pyo3/pull/975)
|
||||
|
||||
### Fixed
|
||||
- Fix passing explicit `None` to `Option<T>` argument `#[pyfunction]` with a default value. [#936](https://github.com/PyO3/pyo3/pull/936)
|
||||
|
|
|
@ -565,11 +565,6 @@ impl MyClass {
|
|||
}
|
||||
```
|
||||
|
||||
Note that defining a class attribute of the same type as the class will make the class unusable.
|
||||
Attempting to use the class will cause a panic reading `Recursive evaluation of type_object`.
|
||||
As an alternative, if having the attribute on instances is acceptable, create a `#[getter]` which
|
||||
uses a `GILOnceCell` to cache the attribute value. Or add the attribute to a module instead.
|
||||
|
||||
## Callable objects
|
||||
|
||||
To specify a custom `__call__` method for a custom class, the method needs to be annotated with
|
||||
|
|
Loading…
Reference in New Issue