Commit Graph

2103 Commits

Author SHA1 Message Date
scalexm 7b5a076680 Add `#[classattr]` methods to define Python class attributes 2020-05-07 21:23:47 +02:00
Yuji Kanagawa 626268d28a
Merge pull request #899 from fusion-engineering-forks/mutex
Simplify ReleasePool, remove parking_lot dependency.
2020-05-05 18:09:20 +09:00
Yuji Kanagawa c8fb8fcc12
Merge pull request #797 from davidhewitt/catch-unwind
Add catch_unwind! macro to prevent panics crossing ffi boundaries
2020-05-05 17:45:29 +09:00
David Hewitt 9380bfde6f Add catch_unwind! macro to prevent panics crossing ffi boundaries 2020-05-05 08:17:06 +01:00
Mara Bos 0407288758 Simplify ReleasePool, remove parking_lot dependency.
Replaces the parking_lot Mutex by a simple AtomicBool spinlock,
and simplifies the ReleasePool to contain one Vec instead of pointers to
two Vecs.
2020-05-05 08:08:07 +02:00
Yuji Kanagawa c4f36535d8
Merge pull request #895 from fusion-engineering-forks/tryfrom
Replace num-traits dependency by std's TryFrom.
2020-05-05 12:26:35 +09:00
Yuji Kanagawa 9f1861034b
Merge pull request #901 from davidhewitt/simplify-callbacks
Simplify callback code using callback_body! macro
2020-05-05 12:25:03 +09:00
David Hewitt a19ed50515
Merge pull request #900 from Alexander-N/broken-links
Fix some broken links in guide
2020-05-05 01:43:12 +01:00
David Hewitt 9a2d908342 Simplify callback code using callback_body! macro 2020-05-05 00:27:50 +01:00
Alexander Niederbühl 618de30606 Fix broken links in guide 2020-05-04 23:22:42 +02:00
Mara Bos c4e68e6286
Update build.rs and remove serde and regex dependencies. (#896) 2020-05-04 19:51:19 +01:00
Mara Bos 39b41b3dc7 Replace num-traits dependency by std's TryFrom. 2020-05-04 15:50:07 +02:00
Yuji Kanagawa 0f07cf8db9
Merge pull request #886 from fusion-engineering-forks/dir
Add dir() to ObjectProtocol.
2020-05-04 18:07:27 +09:00
Mara Bos d32c3c0b37 Add test for dir(). 2020-05-04 09:57:46 +02:00
Yuji Kanagawa 879b0b58ac
Merge pull request #890 from davidhewitt/no-borrowed-objects
Remove unsound return of borrowed objects
2020-05-04 12:18:52 +09:00
David Hewitt 6f74fe6b38 Allow borrowed object for PyTuple::get_item.
As per feedback on #890
2020-05-03 18:48:01 +01:00
Yuji Kanagawa 78c51d3596
Merge pull request #891 from davidhewitt/benches
New benchmarks
2020-05-03 21:34:20 +09:00
Mara Bos 36ebd0566c Update CHANGELOG.md. 2020-05-03 14:32:43 +02:00
Mara Bos 49d31a0134 Add dir() to ObjectProtocol. 2020-05-03 14:32:43 +02:00
David Hewitt e1533129c9 Remove bench_pyclass 2020-05-03 11:12:31 +01:00
Yuji Kanagawa e9bec070e1
Merge pull request #887 from kngwyu/new-nativetypes
New Native Types and Lighter GILPool
2020-05-03 12:10:43 +09:00
David Hewitt be09aa00aa New benchmarks 2020-05-02 23:38:36 +01:00
David Hewitt b7ecec7812 Remove unsound return of borrowed objects 2020-05-02 23:35:26 +01:00
kngwyu 75c807f31d Less borrow in GILPool::drop 2020-05-02 23:39:52 +09:00
Yuji Kanagawa f2b347a9f6
Merge pull request #2 from davidhewitt/new-nativetypes
Thread-safe release pools
2020-05-02 22:10:45 +09:00
Yuji Kanagawa 17cf97df7d
Merge pull request #889 from kngwyu/refactor-pymethods-inventory
Unify PyMethodsInventoryDispatch and PyMethodsProtocol
2020-05-02 21:48:29 +09:00
David Hewitt dfbe22bb56 Thread-safe release pools 2020-05-02 13:16:22 +01:00
kngwyu b6befcfb93 CHANGELOG and better docs for PyMethodsImpl 2020-05-02 18:46:48 +09:00
kngwyu 816c50a649 Unify PyMethodsInventoryDispatch and PyMethodsProtocol 2020-05-02 17:48:25 +09:00
kngwyu 39bfb5f0d5 Clean up gil tests 2020-05-02 15:33:10 +09:00
kngwyu 8c6cbb605a Better docs for new unchecked_downcast and borrowed objects 2020-05-02 14:58:12 +09:00
kngwyu 823b8e7f8a New Native Types and lighter GILPool 2020-05-02 14:54:13 +09:00
Yuji Kanagawa e40f022014
Merge pull request #888 from PyO3/remove-no-landing-pads
Remove -Zno-landing-pads
2020-05-02 14:51:42 +09:00
kngwyu e6f8fa76af Remove no-landing-pads 2020-05-02 13:57:49 +09:00
Austin Bingham 746c352ca8
Clarified documentation for implementing iteration. (#882)
* Clarified documentation for implementing iteration.

* Updated example so that it compiles.

* Updated PyIterProtocol docs per discussion.

* Added link to Python docs on iterators.

* Improved language regarding iterables and PyIterProtocol.

* Fixed assertion calls.
2020-04-28 17:46:20 +09:00
Yuji Kanagawa e9e0da57a8
Merge pull request #880 from davidhewitt/py_get_set
Allow use of `#[pyo3(get, set)]` with `Py<T>`
2020-04-23 16:05:05 +09:00
David Hewitt 3008528fa6 Allow use of `#[pyo3(get, set)]` with `Py<T>` 2020-04-22 22:21:27 +01:00
Mara Bos dcab478d66
Fix lifetime safety bug of AsPyRef::as_ref(). (#876)
* Fix lifetime safety bug of AsPyRef::as_ref().

Fixes #875.

* Add test for AsPyRef's lifetimes.
2020-04-20 18:44:31 +01:00
Yuji Kanagawa a58a1cf4c6
Merge pull request #856 from althonos/patch-iter
Allow passing non-mutable references to self in PyIterProtocol
2020-04-19 23:08:31 +09:00
Martin Larralde 6ac1b0503c Fix pattern matching style in `pyo3-derive-backend` code 2020-04-19 13:05:46 +02:00
Martin Larralde 378a6a484c Move `TryFromPyCell` trait to `derive_utils` module 2020-04-19 12:57:31 +02:00
Martin Larralde b3c937c73a Reformat code with `rustfmt` 2020-04-18 03:59:42 +02:00
Martin Larralde f36f19cea4 Update guide to show using `PyRef` within `__iter__` method 2020-04-18 03:57:17 +02:00
Martin Larralde ed63902eeb Modify existing `PyIteratorProtocol` tests to use `PyRef` where possible 2020-04-18 03:57:17 +02:00
Martin Larralde 187d889565 Make `PyIterProtocol` methods accept both `PyRef` and `PyRefMut` 2020-04-18 03:57:17 +02:00
Martin Larralde 42e84ea6ff Add compatibility trait `TryFromPyCell` to `pyo3::pycell` 2020-04-18 03:38:27 +02:00
Yuji Kanagawa c8971552cf
Merge pull request #871 from PyO3/remove-konstin-from-coc
Remove myself from the CoC
2020-04-13 23:42:44 +09:00
konstin 3253cc86a6
Remove myself from the CoC
I'm not active on this project anymore, so I shouldn't be the CoC contact.

@kngwyu @davidhewitt Feel free to add yourself instead.
2020-04-13 13:38:41 +02:00
Yuji Kanagawa d5b696f7ac
Merge pull request #869 from kngwyu/unsafe-gilpool
Bound 'py lifetime by GILPool in the internal usecases
2020-04-13 12:19:27 +09:00
Yuji Kanagawa ae81865232 Apply suggestions from David
Co-Authored-By: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-04-13 11:05:48 +09:00