Commit graph

93 commits

Author SHA1 Message Date
konstin 45bb09b3e8 Relax return type requirements
Allows returning essentially arbitrary types by wrapping them into a PyResult. This is done with a conversion trait that specializes for PyResult.
2018-04-06 17:22:09 +02:00
Nikolay Kim b738c1a04b clippy warnings 2018-01-19 10:02:36 -08:00
Nikolay Kim a61c5e56a0 add convenience method to PyErr and exception types 2017-08-04 11:47:35 -07:00
Nikolay Kim b3cc6f1e61 fix clippy warnings 2017-08-03 11:55:39 -07:00
Nikolay Kim 8227ce81e2 various cleanups 2017-07-26 20:29:07 -07:00
Nikolay Kim 139a31b1e4 implement ToPyObject and IntoPyObject for PyErr 2017-07-26 16:13:45 -07:00
Nikolay Kim e5c1fcf11d no need mut for PyErr::clone_ref; IntoPyTuple::to_tuple is not needed 2017-07-26 15:08:34 -07:00
Nikolay Kim a4fd878cb7 pyerr cleanups 2017-07-26 14:28:04 -07:00
Nikolay Kim a20230e73f Create rust type for exceptions defined in python #45 2017-07-26 12:56:07 -07:00
Nikolay Kim e45eb6e878 rename ToPyErr to PyErrArguments 2017-07-26 10:47:17 -07:00
Nikolay Kim b250ad22ca update guide related to exception 2017-07-26 09:16:26 -07:00
Nikolay Kim a120bbf15e Refactor implementation. Drop parameter from constructor 2017-07-26 01:11:00 -07:00
Nikolay Kim 86252cda4c simplify PyTypeInfo and PyTypeObject 2017-07-25 18:39:11 -07:00
Nikolay Kim 65a42a2b1a remove py param 2017-07-25 18:11:45 -07:00
Nikolay Kim fc1df289bd drop PyClone trait; doc cleanups 2017-07-18 10:13:50 -07:00
messense e69163344a Fix some clippy warnings (#49) 2017-07-18 19:28:49 +08:00
Nikolay Kim 3028dcf58f fix error from instancel fixed bool 2017-06-30 08:51:45 +06:00
Nikolay Kim 3a2004eab2 rename PyInstance to PyObjectRef 2017-06-24 08:28:31 -07:00
messense 84ebdbcfe9
Add copyright headers to some files 2017-06-24 16:36:51 +08:00
Nikolay Kim a58aa7b5e6 rename PyObject 2017-06-22 20:56:09 -07:00
Nikolay Kim b9377849c8 rename modules 2017-06-22 01:16:22 -07:00
Nikolay Kim c48386affa stopping point 2017-06-22 01:04:37 -07:00
Nikolay Kim af663e0f80 update PyType 2017-06-21 15:11:32 -07:00
Nikolay Kim 7cf8e1ab80 modify PyDict 2017-06-21 14:08:16 -07:00
Nikolay Kim 40efa5c955 rename Ptr to Py 2017-06-19 23:57:34 -07:00
messense f681038133
Prefer expect() and map_err() to unwrap() 2017-06-17 17:40:11 +08:00
Nikolay Kim 0679fec859 update docs 2017-06-15 11:13:58 -07:00
Nikolay Kim 3b4d147219 initial impl for py2 2017-06-11 16:35:24 -07:00
messense cb68cd23a2 Fix some clippy warnings (#26) 2017-06-11 23:46:23 +08:00
Nikolay Kim ea8f11fa6d refactor PyTypeObject trait 2017-06-08 14:34:29 -07:00
messense e12e98a7c1 Convert some std error types to PyErr (#22)
* Convert some std error types to PyErr

* Add ToPyErr trait
2017-06-08 09:40:30 +08:00
Nikolay Kim a584ce12e5 release py objects aftre use 2017-06-06 19:26:59 -07:00
Nikolay Kim 84f5578997 varios cleanups 2017-06-05 20:25:00 -07:00
Nikolay Kim a448aa54cc clone_ref return Self 2017-06-03 17:42:12 -07:00
Nikolay Kim 57cc139c81 drop Py pointer 2017-06-03 17:27:26 -07:00
Nikolay Kim b75160daf3 remove pyobject lifetime 2017-06-02 18:58:16 -07:00
Nikolay Kim 27bd365f5c cleanups 2017-06-02 09:23:48 -07:00
Nikolay Kim cbfdfa2d07 better naming 2017-06-01 15:06:48 -07:00
Nikolay Kim fc762288fe use From instead of as_object; fix type object 2017-06-01 13:34:46 -07:00
Nikolay Kim 4cdb77335e reenable buffer tests 2017-05-31 16:26:21 -07:00
Nikolay Kim 2f3ea202b3 add mirror ptr types for native py classes 2017-05-31 15:52:13 -07:00
Nikolay Kim 92bf7b9c05 rename pptr to PyObjectPtr 2017-05-31 01:08:39 -07:00
Nikolay Kim 3040ac12b9 refactor ToPyObject 2017-05-30 17:23:23 -07:00
Nikolay Kim b8913a3705 refactor IntoPyObject trait; rename pptr into pyptr, introduce pptr pointers 2017-05-30 16:29:13 -07:00
Nikolay Kim 61b8bd0695 fix ptr borrowing PyTuple::get_item 2017-05-29 18:36:44 -07:00
Nikolay Kim ad38688378 fix sequence protocol; convert buffer protocol 2017-05-29 15:08:19 -07:00
Nikolay Kim 51ac8c9c78 better gil token scope 2017-05-29 13:30:38 -07:00
Nikolay Kim ea8ccf190a special treatment for native python objects 2017-05-29 02:47:27 -07:00
Nikolay Kim 55d0d58734 added pptr pointer 2017-05-28 21:19:29 -07:00
Nikolay Kim 969cba2c16 remove Token 2017-05-28 08:57:34 -07:00