2806: add .python-version file r=messense a=davidhewitt
This looks like it's recommended for `actions/setup-python` if we don't specify a version in the CI.yml
It may also be helpful for contributors testing using pyenv?
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2795: accept any iterator for `PySet::new` and `PyFrozenSet::new` r=birkenfeld a=davidhewitt
Closes#2789
Looks like it's about 20% faster in the case I benchmarked to use `PySet_Add` directly without the intermediate list.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2788: Define _PyErr_ChainExceptions() FFI for CPython r=davidhewitt a=ijl
This appears to be the only way to chain exceptions via the FFI. It was introduced prior to CPython 3.7. It has some description of usage in PEP 490. There was a discussion of whether it should be made stable in BPO 44938.
Co-authored-by: ijl <ijl@mailbox.org>
This appears to be the only way to chain exceptions via the FFI. It
was introduced prior to CPython 3.7. It has some description of usage
in PEP 490. There was a discussion of whether it should be made stable
in BPO 44938.
2779: Mention `into_py` in docs for PyTuple::new r=davidhewitt a=hauntsaninja
I'm new to Rust / PyO3, and it took me a little bit to figure this out :-)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2776: add abi3-py311 feature r=messense a=davidhewitt
Just noticed this was missing.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2739: error when `#[pyo3(signature = ())]` used on invalid methods r=davidhewitt a=davidhewitt
A follow-up to #2702 to reject some invalid applications of `#[pyo3(signature = (...))]` attribute, specifically on magic methods and getters / setters / class attributes.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2762: Add a nox task to rustfmt code in the guide r=birkenfeld a=birkenfeld
Also apply it. Two caveats:
1) needs nightly rustfmt to be available
2) not all reformat diffs have been applied; using best judgment for readability
Co-authored-by: Georg Brandl <georg@python.org>
AFAIK there isn't currently a link to the article on ["Type Stubs"](https://typing.readthedocs.io/en/latest/source/stubs.html) in the official Python static typing documentation. This PR adds a link to this documentation, which is the most comprehensive I have seen around type stubs.