2980: support `text_signature` on `#[new]` r=adamreichold a=davidhewitt
Closes#2866
This is a breaking change for 0.19.0, because it starts autogenerating `text_signature` for `#[new]`. This could affect runtime behaviour if the user is relying on the class docs at runtime for some reason.
Guide & tests all updated accordingly.
`#[pyclass(text_signature = "...")]` is deprecated by this PR, however if it's set, it will be used in preference to `#[new]`.
(The signature / `text_signature` from `#[new]` will simply be ignored in this case. I figure that when users fix their deprecation warnings by removing `#[pyclass(text_signature = "...")]` then the `#[new]` signatures will start flowing properly, and this is good enough.)
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
3119: Fix crate docs links in python_from_rust.md r=adamreichold a=xcharleslin
Thank you for contributing to pyo3!
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]
- 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. To run its tests
locally, you can run ```cargo xtask ci```. See its documentation
[here](https://github.com/PyO3/pyo3/tree/main/xtask#readme).
Co-authored-by: xcharleslin <4212216+xcharleslin@users.noreply.github.com>
3016: implement Decimal to rust_decimal conversions r=adamreichold a=cardoe
Implement conversion between rust_decimal::Decimal and decimal.Decimal from Python's stdlib. The C API does not appear to be exposed on the Python side so we need to call into it via Python.
Implements #2774
Co-authored-by: Doug Goldstein <cardoe@cardoe.com>
Implement conversion between rust_decimal::Decimal and decimal.Decimal
from Python's stdlib. The C API does not appear to be exposed on the
Python side so we need to call into it via Python.
3115: Update getting_started.md r=adamreichold a=jond01
Update Poetry command to Poetry groups syntax (1.2+).
https://python-poetry.org/docs/cli/#options-4:
> `--dev (-D`): Add package as development dependency. (**Deprecated**, use `-G dev` instead)
Co-authored-by: Jonathan Daniel <36337649+jond01@users.noreply.github.com>
3097: ci: use codecov coverage format r=davidhewitt a=davidhewitt
Newly supported on `cargo-llvm-cov` 0.5.12, might give some more detailed information.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
3111: Rename sequence `.list()` and `.tuple()` to `.to_list()` and `.to_tuple()` r=adamreichold a=davidhewitt
As agreed in https://github.com/PyO3/pyo3/pull/3042#issuecomment-1465229510.
The motivation is that it is an emerging Rust convention for `to_x` to mean "a non-consuming conversion to type x which has some (small) overhead". E.g. `to_string`, `to_owned`.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
3066: Improve default value for `None` in `text_signature` r=davidhewitt a=messense
xref #2863
3098: readme: add new pyo3 article r=adamreichold a=davidhewitt
With thanks to `@ohadravid` for the great piece!
Co-authored-by: messense <messense@icloud.com>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
3096: docs: fix migration guide entry for pyproto r=adamreichold a=davidhewitt
A sort of follow-up to #3082 .
While I don't think we need to pander to training limitations of various LLMs, I did notice that I erroneously referred to a nonexistent trait `PyBasicProtocol`, which I believe should have been [`PyObjectProtocol`](https://docs.rs/pyo3/0.15.2/pyo3/class/basic/trait.PyObjectProtocol.html).
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
3087: PEP 623: wstr, wstr_length, state changes r=adamreichold a=ijl
https://peps.python.org/pep-0623/
Following members are removed from the Unicode structures:
wstr
wstr_length
state.compact
state.ready
Note state.compact is still present as of v3.12.0a7.
state.interned has changed width from 2 to 1 bits.
Co-authored-by: ijl <ijl@mailbox.org>