Commit Graph

31 Commits

Author SHA1 Message Date
David Hewitt cfb91057af frompyobject: improve error message for tuple case 2022-06-02 08:54:20 +01:00
Bruno Kolenbrander dce4377eb4
Allow more methods to take interned arguments (#2312)
* Allow more methods to take interned arguments

* Changelog

* Unify name bounds

* Resolve merge conflict

* reduce use of py_decref

* Add some attr tests

* Update migration
2022-05-02 11:13:15 +02:00
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
Rico Hageman ed698c4b43 Add documentation related to from_py_with for the FromPyObject trait 2022-02-24 22:54:30 +01:00
Rico Hageman fc186cdb3b Remove item annotation in tuple struct 2022-02-24 22:20:54 +01:00
Rico Hageman 76233e1924 Address pull request comments 2022-02-24 11:27:53 +01:00
Rico Hageman 84a763da14 Add test to ensure support for from_py_with for enums 2022-02-24 00:22:33 +01:00
Rico Hageman 10804b0d65 Support from_py_with on struct tuples 2022-02-24 00:06:33 +01:00
David Hewitt 558549e1c2 pyproto: split into new feature 2022-02-05 16:51:31 +00:00
David Hewitt 492b7e4c0f macros: optimize generated code for #[derive(FromPyObject)] 2021-12-22 08:34:05 +00:00
David Hewitt 6433d884fc dev: remove self dev dependency 2021-12-08 07:48:58 +00:00
Georg Brandl 9990bf9d31 Fix some clippy and dead code warnings. 2021-11-24 09:11:39 +01:00
David Hewitt 9e80f3dfdd pep 604: use `T | U` instead of `Union[T, U]` in messaging 2021-09-24 22:46:25 +01:00
R2D2 d809e50c9b Replaced require_gil with Python::with_gil in test_frompyobject.rs. Removed all unsafe code from macro generated code. Two other small fixes 2021-08-02 09:49:13 +02:00
R2D2 3cfc76ae93 Reworked struct error messages to use the of an error rather than concatenating all error messages 2021-07-31 23:21:07 +02:00
R2D2 d3208b005e Removed stray newline character from error message 2021-06-09 14:25:49 +02:00
R2D2 ec40446fa3 Removed stray newline character from error message 2021-06-09 14:23:16 +02:00
R2D2 e6da1ebc73 Fixed formatting of error messages and tests 2021-06-09 11:40:14 +02:00
R2D2 0b3fbb5533 Fixed formatting 2021-06-07 10:26:58 +02:00
R2D2 973f0a5bae Removed the custom error messages from the macro api 2021-06-07 10:18:38 +02:00
R2D2 416b1132b4 Added custom error messages to enum fields and container types. Covered with tests. Fixed formatting and linting issues 2021-06-01 22:44:16 +02:00
R2D2 dfc484c43b Started adding more unit tests 2021-06-01 00:23:54 +02:00
R2D2 1a8fec2e88 Added detailed TypeError messages to enums with derive(FromPyOjbect) 2021-05-31 17:38:15 +02:00
R2D2 4a99bfaaba Fixed tests after modifying TypeErrors originating from structs. Started work on TypeError message on Enums 2021-05-31 00:28:53 +02:00
Daniil Konovalenko 554cffd60d
add #[pyo3(from_py_with="...")] attribute (#1411)
* allow from_py_with inside #[derive(FromPyObject)]
* split up FnSpec::parse
2021-02-21 00:15:20 +09:00
Askaholic 6724783395
Change wording of PyDowncastError display implementation
Displays type(obj) instead of repr(obj) and uses `cannot` instead of
`can't`
to be more consistent with existing python error messages.

See discussion at #1212.
2020-10-14 17:32:00 -08:00
David Hewitt b9e95dc7c9 Implement std::error::Error for PyErr 2020-09-10 19:04:24 +01:00
Sebastian Pütz 0f32f886b8 More FromPyObject derive suggestions by @davidhewitt 2020-08-30 19:16:59 +02:00
Sebastian Pütz 7781bb78de Specify item key and attr name as arguments. 2020-08-30 10:22:01 +02:00
Sebastian Pütz 60fe4925f5 '#[derive(FromPyObject)]` changes suggested by @davidwhewitt. 2020-08-30 10:22:01 +02:00
Sebastian Pütz 7168309464 Derive FromPyObject 2020-08-30 10:22:01 +02:00