Skip to content

Commit

Permalink
docs: add docs for #[pyo3(name = "...")]
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed May 7, 2021
1 parent 48e9881 commit 70f9d19
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pyo3-macros/src/lib.rs
Expand Up @@ -185,8 +185,10 @@ pub fn pymethods(_: TokenStream, input: TokenStream) -> TokenStream {
/// | [`#[classattr]`][9] | Defines a class variable. |
/// | [`#[args]`][10] | Define a method's default arguments and allows the function to receive `*args` and `**kwargs`. |
///
/// For more on creating class methods,
/// see the [class section of the guide][1].
/// Methods within a `#[pymethods]` block can also be annotated with any of the attributes which can
/// be used with [`#[pyfunction]`][attr.pyfunction.html].
///
/// For more on creating class methods see the [class section of the guide][1].
///
/// If the [`multiple-pymethods`][2] feature is enabled, it is possible to implement
/// multiple `#[pymethods]` blocks for a single `#[pyclass]`.
Expand All @@ -210,8 +212,13 @@ pub fn pymethods_with_inventory(_: TokenStream, input: TokenStream) -> TokenStre

/// A proc macro used to expose Rust functions to Python.
///
/// For more on exposing functions,
/// see the [function section of the guide][1].
/// Functions annotated with `#[pyfunction]` can also be annotated with the following:
///
/// | Annotation | Description |
/// | :- | :- |
/// | `#[pyo3(name = "...")]` | Defines the name of the function in Python. |
///
/// For more on exposing functions see the [function section of the guide][1].
///
/// [1]: https://pyo3.rs/main/function.html
#[proc_macro_attribute]
Expand Down

0 comments on commit 70f9d19

Please sign in to comment.