Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: semantic change typo #4561

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

digitalsentinel
Copy link

Thank you for contributing to PyO3!

By submitting these contributions you agree for them to be dual-licensed under PyO3's MIT OR Apache-2.0 license.

Please consider adding the following to your pull request:

  • an entry for this PR in newsfragments - see [https://pyo3.rs/main/contributing.html#documenting-changes]
    • or start the PR title with docs: if this is a docs-only change to skip the check
  • docs to all new functions and / or detail in the guide
  • tests for all new or changed functions

PyO3's CI pipeline will check your pull request, thus make sure you have checked the Contributing.md guidelines. To run most of its tests
locally, you can run nox. See nox --list-sessions
for a list of supported actions.

@alex
Copy link
Contributor

alex commented Sep 17, 2024

I'm reasonably certain this is not a typo, why do you think it is?

@digitalsentinel
Copy link
Author

Sorry, perhaps I was hasty with my change, but this sentence threw me and still does.

Perhaps necessary should be changed to sufficient?

When would a Py<T> not be necessary for lifetime reason?

Happy to close, forget, and apologize for jumping to conclusions.

@birkenfeld
Copy link
Member

birkenfeld commented Sep 17, 2024

Py<T> is "easier" to work with, because it does not carry a lifetime around. That is useful for storing in other pyclasses or long lived structs in general. In those cases it is "necessary to use Py<T> for lifetime reasons" (i.e. to avoid one).

The sentence is correct, but maybe this version is better to understand?

"This means that Bound<'py, T> should usually be used whenever carrying this lifetime is acceptable, and Py<T> otherwise."

@digitalsentinel
Copy link
Author

This is clearer to me.
Thanks!

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