Commit Graph

399 Commits

Author SHA1 Message Date
scalexm 7b5a076680 Add `#[classattr]` methods to define Python class attributes 2020-05-07 21:23:47 +02:00
David Hewitt 9a2d908342 Simplify callback code using callback_body! macro 2020-05-05 00:27:50 +01:00
David Hewitt dfbe22bb56 Thread-safe release pools 2020-05-02 13:16:22 +01: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
Martin Larralde ed63902eeb Modify existing `PyIteratorProtocol` tests to use `PyRef` where possible 2020-04-18 03:57:17 +02: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
kngwyu 2cd466dc46 Bound 'py lifetime by GILPool when it's possible 2020-04-12 23:55:23 +09:00
Yuji Kanagawa 5e285fda78
Fix synchronization of datetime tests (#867)
* Fix synchronization of datetime tests

* Use Mutex instead of RawMutex
2020-04-11 19:10:16 +09:00
kngwyu 9dc3f9dc1a Lock other threads before import datetime to avoid test failure 2020-04-09 22:11:03 +09:00
Martin Larralde 1e8e6fd827 Fix clippy warning about unused arguments in `tests/test_gc.rs` 2020-04-09 02:06:19 +02:00
Martin Larralde 5f2ec47bea Add proper test for GC double borrow issue in `tp_traverse` wrapper 2020-04-09 00:52:49 +02:00
kngwyu 8d1678e28e Separate examples and tooling section in README and the guide 2020-04-02 23:56:19 +09:00
David Hewitt 1efe142566 Fix clippy warning 2020-03-30 11:48:01 +09:00
kngwyu ac418ce020 Inhibit __ipow__ to take Modulo 2020-03-30 03:01:44 +09:00
kngwyu 25eda36353 Speficy METH_COEXIST for some number methods except 2020-03-30 02:02:57 +09:00
kngwyu a76bd7c4e3 Add a test that shows __add__ overrides __radd__ 2020-03-29 00:26:11 +09:00
kngwyu 970e393bb9 Make __r*__ methods work by slot fallback 2020-03-28 18:17:40 +09:00
kngwyu c234476693 chmod -x for test files 2020-03-27 00:41:01 +09:00
kngwyu 5280a281c9 Remove GILPool::new_no_pointer 2020-03-26 19:45:32 +09:00
Yuji Kanagawa 3b8af93aea
Merge pull request #826 from kngwyu/pyclass-err-improve
More ergonomic error messages for invalid #[pyclass] args
2020-03-23 18:51:16 +09:00
Yuji Kanagawa 3b17ab0529 Apply suggestions from code review
Co-Authored-By: Georg Brandl <georg@python.org>
2020-03-23 13:18:38 +09:00
kngwyu 1e39071c04 Retrieve FromPyObject implementation for &PySequence 2020-03-22 20:00:21 +09:00
kngwyu 9b5ea3f46b More ergonomic error messages for invalid #[pyclass] args 2020-03-22 17:13:02 +09:00
kngwyu 02ee7a5afc Expose PyAny to lib.rs and prelude 2020-03-18 13:38:18 +09:00
kngwyu 40077245ea Fix PyModule::dict 2020-03-16 15:45:54 +09:00
kngwyu cea707dd1c Inhibit positional args after * 2020-03-06 14:01:27 +09:00
kngwyu 25069baef4 Fix the interpretation of '*' 2020-03-04 23:48:46 +09:00
kngwyu 96115eaaaa Refactor some tests in test_methods 2020-03-04 20:35:46 +09:00
kngwyu bbe4393b1e Add more tests in method_with_pyclassarg 2020-03-04 20:25:30 +09:00
kngwyu e63e0cbf5a Make it enable to take &PyClass as arguments as pyfunctions/methods 2020-03-04 13:37:26 +09:00
kngwyu 6c652dff8c Merge branch 'master' into pycell 2020-02-25 20:15:17 +09:00
kngwyu 18957159f4 Add tests for inheriting class with dict or weakref 2020-02-25 20:02:27 +09:00
kngwyu 3d0ee2a28d Use AsRef/AsMut instead of as_super/as_super_mut 2020-02-21 20:37:35 +09:00
Andrew Whitehead ca6cb99a4b
Implement buffer release for PyBufferProtocol; change callback signatures to pass PyClassShell
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
2020-02-20 12:48:22 -08:00
kngwyu 1f5cb83ef8 Add tests for mutability checking 2020-02-18 15:28:04 +09:00
kngwyu 4b746af11b Rename unchecked_refmut -> unchecked_mut 2020-02-18 12:55:06 +09:00
kngwyu 2fd2185052 Merge branch 'master' into pycell 2020-02-17 00:07:15 +09:00
kngwyu 8f8b42591a Fix PySelf and AsPyRef 2020-02-16 23:54:55 +09:00
David Hewitt d5509424b2 Make #[pymethods] aware of #[cfg] 2020-02-15 14:07:48 +00:00
kngwyu da4ed398bb Fix PyCell to share BorrowFlag with parents 2020-02-15 18:13:39 +09:00
Yuji Kanagawa 0eb4eb4e58 Merge branch 'master' into property-fixes 2020-02-10 15:13:19 +09:00
kngwyu a6fed34e23 Fix clippy warnings in build.rs and tests 2020-02-10 14:53:13 +09:00
David Hewitt 6c25f6aacc Bump minimum Rust version to 1.42.0-nightly 2020-02-09 10:54:00 +00:00
David Hewitt cea8a9a2b0 Refactor to clean up property descriptor macros 2020-02-08 18:57:30 +00:00
kngwyu a2408cacbb Rename PyClassShell with PyCell 2020-02-08 15:05:13 +09:00
David Hewitt f8c8b8effd Fix for PyObject with `#[pyo3(get)]` 2020-02-07 19:31:13 +00:00
Yuji Kanagawa 14980d742d
Merge pull request #755 from davidhewitt/property-doc
Fix docstrings generated by `[pyo3(get, set)]`
2020-02-03 18:14:54 +09:00
David Hewitt dfb7d7c58d Fix docstrings generated by `[pyo3(get, set)]` 2020-02-03 08:01:30 +00:00
David Hewitt 7531b9fb07 Remove even more uses of `static mut` 2020-01-30 13:24:55 +00:00