Skip to content

Commit

Permalink
docs: note that #[pymodule] will create hidden module, like `#[pyfu…
Browse files Browse the repository at this point in the history
…nction]`
  • Loading branch information
davidhewitt committed Sep 29, 2022
1 parent 470acbb commit 2708270
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyo3-macros/src/lib.rs
Expand Up @@ -30,6 +30,11 @@ use syn::{parse::Nothing, parse_macro_input};
///
/// For more on creating Python modules see the [module section of the guide][1].
///
/// Due to technical limitations on how `#[pymodule]` is implemented, a function marked
/// `#[pymodule]` cannot have a module with the same name in the same scope. (The
/// `#[pymodule]` implementation generates a hidden module with the same name containing
/// metadata about the module, which is used by `wrap_pymodule!`).
///
/// [1]: https://pyo3.rs/latest/module.html
#[proc_macro_attribute]
pub fn pymodule(args: TokenStream, input: TokenStream) -> TokenStream {
Expand Down

0 comments on commit 2708270

Please sign in to comment.