Commit Graph

669 Commits

Author SHA1 Message Date
David Hewitt dbeb3b4453 move some private internals out of public implementation 2023-02-11 21:28:27 +00:00
bors[bot] 9e5c845dee
Merge #2934
2934: guide: add documentation for trailing option arguments r=davidhewitt a=davidhewitt

Following the increased clarity around PyO3's handling of function signatures of 0.18.0, I wanted to add a section to the guide documenting the default-to-none behaviour for trailing `Option<T>` arguments.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-02-07 08:15:57 +00:00
Jeff Hodges bc1a33f9fe
bump maturin version in getting_started.md
Latest maturin is 0.14.x
2023-02-04 00:09:04 -08:00
Julien Jerphanion 9306d56b27 docs: Precise the abscense of `py: Python` for the #[pyo3(signature)] 2023-02-03 20:57:23 +00:00
David Hewitt c709f30638 guide: add documentation for trailing option arguments 2023-02-03 20:54:51 +00:00
David Hewitt e83803e813 add link on how to obtain GIL to guide 2023-01-20 08:21:57 +00:00
David Hewitt 586fed2c4b send errors in `__releasebuffer__` to `sys.unraisablehook` 2023-01-19 19:10:06 +00:00
David Hewitt ca1bbe3d39 add migration notes for PyO3 0.18 2023-01-17 08:14:32 +00:00
David Hewitt 20ca3be659 inspect: gate behind `experimental-inspect` feature 2023-01-15 12:41:23 +00:00
David Hewitt eea2a31bd3 adjust location and wording for extension module memory management 2023-01-10 07:42:39 +00:00
Haixuan Xavier Tao 8af9d2a19a Add a section on memory management for `extension`
Adding a special case of memory management when writing an extension.

This is a documentation of: https://github.com/PyO3/pyo3/issues/1056 and https://github.com/PyO3/pyo3/issues/2853
2023-01-10 07:37:21 +00:00
David Hewitt 8651d3b0e8 address feedback in review #2678 2023-01-06 08:53:00 +00:00
James Welchman e52dbc907d GH-2649 example for inserting moulde in sys.dict 2023-01-05 21:26:47 +00:00
messense c722402e46
Fix links in `logging.md` 2023-01-03 20:03:51 +08:00
Dylan Storey fefd224e4a Update logging.md for logging->rust
Demonstrates how to register a rust log consumer with a pythong logging instance.
2023-01-03 10:22:54 +00:00
David Hewitt f2608a923c remove functionality deprecated in 0.16 2022-12-28 12:23:53 +00:00
David Hewitt 5039fd746a add automatic text signature generation 2022-12-24 09:43:02 +00:00
David Hewitt 97487ffbb5 add abi3-py311 feature 2022-11-23 08:08:12 +00:00
Georg Brandl f1f1ffcdc7 More typos and grammar. 2022-11-23 07:42:53 +01:00
Georg Brandl c91ed70bbc Fix various typos/omissions in guide. 2022-11-23 07:42:17 +01:00
Georg Brandl 5f7d67615c Use PYO3_DOCS_URL in guide-to-rustdoc links. 2022-11-23 07:42:17 +01:00
bors[bot] 08423557d4
Merge #2739
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>
2022-11-22 19:41:27 +00:00
bors[bot] b485199cfb
Merge #2762
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>
2022-11-22 11:11:19 +00:00
Georg Brandl a7a53d6c0d Add a nox task to rustfmt code in the guide.
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.
2022-11-22 09:19:40 +01:00
Saul Shanabrook 8a75352122
Add link to Python typing docs for type stubs
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.
2022-11-21 16:48:43 -05:00
Matthew Lloyd b2014c30aa
guide: linkify "Method arguments" in class.md 2022-11-20 16:33:15 -05:00
David Hewitt 8ca41be87b
Merge pull request #2749 from PyO3/2748-fix
Fix being able to call arg-less `#[new]` with any args from Python
2022-11-20 11:39:42 +00:00
Georg Brandl 51eeb6db96 guide: explain how #[new] works w.r.t. native base types 2022-11-20 08:25:42 +01:00
Georg Brandl 77f5fc107e guide: better document negative index behavior w.r.t. PySequence
Fixes #2601
2022-11-20 08:09:50 +01:00
Georg Brandl c489809938 Py/PyAny: deprecate cast_as() in favor of downcast()
They are (practically) identical on PyAny, and `downcast()` is the more
useful name.
2022-11-18 07:00:40 +01:00
David Hewitt 00fc0358b9 error when `#[pyo3(signature = ())]` used on invalid methods 2022-11-17 08:28:34 +00:00
messense dee791de90
`pyo3-build-config`: rebuild when `PYO3_ENVIRONMENT_SIGNATURE` value changed 2022-11-09 20:28:18 +08:00
Marc Garcia 47490a7a31
Fix module name in getting started 2022-11-01 14:08:28 +07:00
David Hewitt 8e8b484169
add `#[pyo3(signature = (...))]` attribute (#2702) 2022-10-25 07:23:21 +01:00
David Hewitt 446c0e82f0
Merge pull request #2692 from mejrs/all
Implement get/set all on pyclass
2022-10-18 21:39:44 +01:00
Georg Brandl 676227d2a1
Make `is_instance()` and `is_subclass()` take `&PyAny` (#2695) 2022-10-18 19:22:23 +02:00
mejrs d254134154 Implement get/set all on pyclass 2022-10-17 02:37:43 +02:00
C. Titus Brown ca1c9c1dba update per review 2022-10-16 11:04:15 -07:00
C. Titus Brown 8e6bf1875f
Apply suggestions from code review
Co-authored-by: Georg Brandl <georg@python.org>
2022-10-16 11:01:15 -07:00
C. Titus Brown 78e4130762
Update getting_started.md 2022-10-15 20:55:49 -07:00
C. Titus Brown b265ee7907
Point new users at specific source file for Rust code.
This was a minor confusion for me so I thought I'd suggest the change - it was the first place I looked, but I did have to think about it :)
2022-10-15 20:49:24 -07:00
Bruno Kolenbrander c9b26f57cd
Merge pull request #2657 from mejrs/decorator_fix
Update decorator to use Cell counter
2022-10-10 19:55:36 +02:00
mejrs d8fa6be28a is 2022-10-04 19:33:02 +02:00
mejrs e0602b641c Just use Cell 2022-10-04 19:05:44 +02:00
mejrs 611ea4db49 Update decorator to use atomics 2022-10-04 17:59:46 +02:00
David Hewitt bd40011e93 release: 0.17.2 2022-10-04 08:13:53 +01:00
David Hewitt 372176630e guide: doctest function/ subpages 2022-09-27 07:52:14 +01:00
Bruno Kolenbrander fad5f6a07a
Merge pull request #2639 from mrob95/err-self-typo
docs: fixed typo in error_handling.md
2022-09-26 23:16:26 +02:00
smheidrich 2dd3c6c71f Document needing resolve-config for pyo3 cfgs 2022-09-24 16:18:05 +02:00
smheidrich a731c2ae60 Fix pyo3-build-config version in docs 2022-09-24 15:50:41 +02:00