Add entry to `CHANGELOG.md`
This commit is contained in:
parent
ad9e676512
commit
72003ec37a
|
@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
## Fixed
|
||||
### Added
|
||||
|
||||
* Have `PyModule` generate an index of its members (`__all__` list).
|
||||
|
||||
### Fixed
|
||||
|
||||
* `type_object::PyTypeObject` has been marked unsafe because breaking the contract `type_object::PyTypeObject::init_type` can lead to UB.
|
||||
* Fixed automatic derive of `PySequenceProtocol` implementation in [#423](https://github.com/PyO3/pyo3/pull/423).
|
||||
|
|
|
@ -83,7 +83,7 @@ impl PyModule {
|
|||
pub fn index(&self) -> PyResult<&PyList> {
|
||||
match self.getattr("__all__") {
|
||||
Ok(idx) => idx.downcast_ref().map_err(PyErr::from),
|
||||
Err(err) =>
|
||||
Err(err) => {
|
||||
if err.is_instance::<exceptions::AttributeError>(self.py()) {
|
||||
let l = PyList::empty(self.py());
|
||||
self.setattr("__all__", l).map_err(PyErr::from)?;
|
||||
|
@ -91,6 +91,7 @@ impl PyModule {
|
|||
} else {
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,7 +159,9 @@ impl PyModule {
|
|||
where
|
||||
V: ToPyObject,
|
||||
{
|
||||
self.index()?.append(name).expect("could not append __name__ to __all__");
|
||||
self.index()?
|
||||
.append(name)
|
||||
.expect("could not append __name__ to __all__");
|
||||
self.setattr(name, value)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue