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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: pile of tweaks and additions #2580

Merged
merged 8 commits into from
Aug 23, 2022
Merged

Conversation

davidhewitt
Copy link
Member

@davidhewitt davidhewitt commented Aug 21, 2022

I was stuck on the train this afternoon with barely a working internet connection, so what better thing to do than close a whole pile of docs issues 馃槃

I tried to land everything (mostly) as separate commits. Changes included:

All reviews welcome, I'll probably merge this on Tuesday if I haven't heard anything so that it can be part of the published 0.17 guide. Figure even if it's not perfect it's probably better than not including in the release :)

@messense
Copy link
Member

Rendered

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Member

@mejrs mejrs left a comment

Choose a reason for hiding this comment

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

Thanks, this is great!

Comment on lines 216 to 217
- Concrete functions, e.g. `fn foo()`: add `#[pyfunction]` and then use [`wrap_pyfunction!`] to get the corresponding [`PyCFunction`].
- Dynamic functions, e.g. `foo: fn()` either:
Copy link
Member

Choose a reason for hiding this comment

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

What about "named" and "anonymous/closures" versus "concrete" and "dynamic"? I don't think many people are familiar with those terms.

Copy link
Member Author

Choose a reason for hiding this comment

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

Much better


The Rust compiler will not permit implementation of traits for types outside of the crate where the type is defined. (This is known as the "orphan rule".)

Given a type `OtherError` which is defined in thirdparty code, there are two main strategies available to integrate it with PyO3:
Copy link
Member

Choose a reason for hiding this comment

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

This should be third-party or third party? (same for the other usages). I'm not a native english speaker so I'm not sure 馃樅

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I think third-party is the adjective form and third party the noun from looking at https://dictionary.cambridge.org/dictionary/english/third-party, so I will use third-party here.

@davidhewitt davidhewitt merged commit bc03d6a into PyO3:main Aug 23, 2022
@davidhewitt davidhewitt deleted the docs-bonanza branch August 23, 2022 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment