From 241b586b5a4fc1224d055870bd326e25b0a3c028 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 31 Aug 2021 19:59:41 -0700 Subject: [PATCH] add correct __all__ to module --- src/python.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/python.rs b/src/python.rs index b12af3c..452ae0e 100644 --- a/src/python.rs +++ b/src/python.rs @@ -424,5 +424,15 @@ fn power_instruction_analyzer(_py: Python, m: &PyModule) -> PyResult<()> { )?; wrap_all_instr_fns!(m); + + let mut all = Vec::new(); + for (k, _) in m.dict() { + let k = k.extract::()?; + if !k.starts_with('_') { + all.push(k); + } + } + m.setattr("__all__", all)?; + Ok(()) } -- 2.30.2