Skip to content

docs: Add an example for wrap_pyfunction#5923

Merged
davidhewitt merged 2 commits intoPyO3:mainfrom
Alc-Alc:docs-for-wrap_pyfunction
Apr 29, 2026
Merged

docs: Add an example for wrap_pyfunction#5923
davidhewitt merged 2 commits intoPyO3:mainfrom
Alc-Alc:docs-for-wrap_pyfunction

Conversation

@Alc-Alc
Copy link
Copy Markdown
Contributor

@Alc-Alc Alc-Alc commented Mar 29, 2026

  • Add an example for wrap_pyfunction
  • Clarify in function.md that the macro docs includes an example

Clarify in `function.md` that the macro docstring includes an example
@Alc-Alc Alc-Alc changed the title docs(macros): Add an example for wrap_pyfunction docs: Add an example for wrap_pyfunction Mar 29, 2026
@Alc-Alc
Copy link
Copy Markdown
Contributor Author

Alc-Alc commented Mar 29, 2026

  1. I am not sure how to backlink to the "examples" section in docstring from the markdown files, so I added a note to indicate that an example exists, can be removed if redundant.
  2. Can a maintainer / anyone help me with the CI? I ran cargo test --doc macros locally and the added docstring does pass locally.

@winstxnhdw
Copy link
Copy Markdown
Contributor

  1. I am not sure how to backlink to the "examples" section in docstring from the markdown files, so I added a note to indicate that an example exists, can be removed if redundant.

Why not just link to the line number range?

Copy link
Copy Markdown
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@davidhewitt davidhewitt added this pull request to the merge queue Apr 29, 2026
Merged via the queue into PyO3:main with commit 55aeac8 Apr 29, 2026
46 checks passed
@Alc-Alc Alc-Alc deleted the docs-for-wrap_pyfunction branch April 30, 2026 03:34
davidhewitt pushed a commit to davidhewitt/pyo3 that referenced this pull request May 1, 2026
* docs(macros): Add an example for `wrap_pyfunction`

Clarify in `function.md` that the macro docstring includes an example

* chore: apply formatting

---------

Co-authored-by: Alc-Alc <alc@localhost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants