Merge pull request #1509 from PyO3/issue-1508
Remove __doc__ from module's __all__
This commit is contained in:
commit
873a275ead
|
@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
- `PyTypeObject_INIT` [#1429](https://github.com/PyO3/pyo3/pull/1429)
|
||||
- `PyObject_Check`, `PySuper_Check`, and `FreeFunc` [#1438](https://github.com/PyO3/pyo3/pull/1438)
|
||||
- Remove pyclass implementation details `Type`, `DESCRIPTION`, and `FLAGS` from `PyTypeInfo`. [#1456](https://github.com/PyO3/pyo3/pull/1456)
|
||||
- Remove `__doc__` from module's `__all__`. [#1509](https://github.com/PyO3/pyo3/pull/1509)
|
||||
|
||||
### Fixed
|
||||
- Remove FFI definition `PyCFunction_ClearFreeList` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425)
|
||||
|
|
|
@ -320,7 +320,7 @@ impl ModuleDef {
|
|||
return Err(crate::PyErr::fetch(py));
|
||||
}
|
||||
let module = py.from_owned_ptr_or_err::<PyModule>(module)?;
|
||||
module.add("__doc__", doc)?;
|
||||
module.setattr("__doc__", doc)?;
|
||||
initializer(py, module)?;
|
||||
Ok(crate::IntoPyPointer::into_ptr(module))
|
||||
}
|
||||
|
|
|
@ -226,6 +226,15 @@ fn test_module_dict() {
|
|||
py_assert!(py, module, "module.yay == 'me'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_module_dunder_all() {
|
||||
let gil = Python::acquire_gil();
|
||||
let py = gil.python();
|
||||
let module = pyo3::wrap_pymodule!(foobar_module)(py);
|
||||
|
||||
py_assert!(py, module, "module.__all__ == ['foobar']");
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn subfunction() -> String {
|
||||
"Subfunction".to_string()
|
||||
|
|
Loading…
Reference in New Issue