Commit Graph

118 Commits

Author SHA1 Message Date
David Hewitt e28403e772 call PyObject_GC_Untrack before deallocating 2023-09-09 22:29:58 +01:00
David Hewitt 4c46d81afd simplify thread checker implementation 2023-09-03 14:15:26 +01:00
DataTriny 1a73ce6e60 Address review comments 2023-08-15 20:56:13 +02:00
DataTriny f02fe9478d
Make rename_all accept a renaming rule, allow applying it to classes as well 2023-08-15 10:15:48 +02:00
DataTriny a9e9ec628d
Add attribute to 2023-08-13 18:25:07 +02:00
David Hewitt e86dbab387 macros: `_py` -> `py` 2023-07-29 21:24:11 +01:00
David Hewitt 56b7c38e24 improve error span for mutable access to `#[pyclass(frozen)]` 2023-07-11 22:34:53 +01:00
Alex Gaynor afbb1d435c
Upgrade to syn 2 2023-06-14 07:03:33 -04:00
David Hewitt 45b5ede26a remove copyright headers from source files 2023-06-03 22:38:54 +01:00
David Hewitt 8bd17f02c7 support `text_signature` on `#[new]` 2023-05-04 07:15:11 +01:00
David Hewitt c7cc48f8e4 use PyO3 types within LazyTypeObject 2023-02-18 09:06:36 +00:00
David Hewitt 00ddd21535 change PyModule::add_class to return an error if class creation fails 2023-02-14 22:08:35 +00:00
David Hewitt dbeb3b4453 move some private internals out of public implementation 2023-02-11 21:28:27 +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
mejrs 08c8b845aa Create better error spans/messages 2022-10-18 21:14:22 +02:00
mejrs d254134154 Implement get/set all on pyclass 2022-10-17 02:37:43 +02:00
David Hewitt c5ba1f0632
pyclass: better error and explanation why lifetimes are disallowed (#2633)
* pyclass: better error and explanation why lifetimes are disallowed

* extend detail on lifetimes
2022-09-22 11:14:06 +02:00
Jonathan Coates 26a9603519 Some improvements to __richcmp__ on enums
- Implement __ne__ as well as __eq__.
 - Return NotImplemented when types cannot be converted, rather than
   throwing.
 - Compare the integer ids inside the __eq__/__ne__ implementation.
   Previously a match block was generated.
2022-09-16 15:30:56 +01:00
David Hewitt 5718adeec7 pyproto: remove deprecated feature 2022-09-06 08:38:44 +01:00
David Hewitt d0492b7c72
Merge pull request #2570 from davidhewitt/pyclass-frozen-tidy
pyclass: tidy up frozen implementation
2022-08-21 09:35:51 +01:00
David Hewitt 24456f3f41 pyclass: tidy up frozen implementation 2022-08-21 08:21:06 +01:00
David Hewitt fd8026c7bb pyclass: add `sequence` option to implement `sq_length` 2022-08-20 07:14:26 +01:00
David Hewitt 209c942277 pyfunction: use extract_argument with holder to avoid extractext 2022-07-14 08:42:22 +01:00
David Hewitt 4da9c3a55f llvm-lines: use iterator to collect class items 2022-06-25 22:03:28 +01:00
Gabriel Smith 75656949f9 macros: Support #[pyo3(name)] on enum variants 2022-06-22 09:36:40 -04:00
Gabriel Smith 2122faa547 macros: Use macro-defined name for enums in __repr__ 2022-06-21 16:31:23 -04:00
David Hewitt 7725f17c46 pyclass: switch from immutable to frozen 2022-06-19 21:18:15 +01:00
David Hewitt f81a01b604 macros: emit pymethod associated methods as a single block 2022-06-16 22:15:29 +01:00
David Hewitt eafbbc5417
Merge pull request #2399 from davidhewitt/avoid-duplicate-pymethods
pymethods: prevent methods sharing the same name
2022-05-24 22:22:31 +01:00
David Hewitt 71abeeff8b macros: fix raw-ident pyclasses having r# at the start of the Python name 2022-05-24 21:34:23 +01:00
David Hewitt a306365db8 pymethods: prevent methods sharing the same name 2022-05-24 21:15:30 +01:00
David Hewitt e9bd41efb2 better mutability inheritance rules 2022-04-21 20:51:28 +01:00
Bruno Kolenbrander bc6bd6099c
Merge branch 'main' into immutable 2022-04-12 14:22:33 +02:00
mejrs b7745dffc8 Fix everything 2022-04-12 14:19:02 +02:00
David Hewitt c16cc35b30 pyclass: mapping flag 2022-04-02 16:15:44 +01:00
mejrs 086424b88c Merge branch 'main' of https://github.com/mejrs/pyo3 into immutable 2022-04-01 23:11:02 +02:00
mejrs 9ab1e6927a Merge branch 'immutable' of https://github.com/mejrs/pyo3 into immutable 2022-04-01 22:59:59 +02:00
mejrs 1b9763fef2 Fix merge conflict 2022-03-23 10:10:35 +01:00
Bruno Kolenbrander fb689340b4
Merge branch 'main' into lint-more 2022-03-23 09:34:31 +01:00
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
David Hewitt 5cc3ce99f1 pyclass: unify pyclass with its pyo3 arguments 2022-03-20 08:24:09 +00:00
David Hewitt ddf13ea98f clippy: enable some more lints 2022-03-03 07:23:28 +00:00
Rico Hageman 10804b0d65 Support from_py_with on struct tuples 2022-02-24 00:06:33 +01:00
David Hewitt 79123b396c pyclass: deprecate gc option 2022-02-15 08:01:46 +00:00
David Hewitt 676295b8de pymethods: support gc protocol 2022-02-15 08:01:23 +00:00
mejrs a8ec8b4176 Make Pyo3MethodsInventoryFor<class>::new public 2022-02-14 23:27:54 +01:00
David Hewitt f5b2a88a70 refactor: include __new__ as slot 2022-02-09 08:07:14 +00:00
David Hewitt 75e44585de refactor: pass tp_alloc and tp_free via slots 2022-02-09 08:07:14 +00:00
David Hewitt 4d471077b4 refactor: inline pyclass_default_items trait 2022-02-08 19:39:37 +00:00