Commit graph

190 commits

Author SHA1 Message Date
konstin 15204bab56 Better way to add functions to modules 2018-05-02 19:26:54 +02:00
konstin 0880ac166c Merge master 2018-05-01 20:41:35 +02:00
konstin d0c42dfcc1 Fix compilation on nightly 2018-05-01 15:44:38 +02:00
konstin 6113428746 Allow defining functions outside of the module declarations
This commit consists of
 * a proc macro to convert rust functions into python functions (`#[function]`),
 * a macro to register a function in a module (`add_function_to_module!`)
 * Documenting both the old and the new way in the book
2018-04-30 23:17:09 +02:00
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 b7a8d25338 const fns that we use are stable now 2018-02-21 09:23:58 -08:00
Nikolay Kim b738c1a04b clippy warnings 2018-01-19 10:02:36 -08:00
Nikolay Kim 324a6b2697 drop RefFromPyObject; allow mut refs #106 2018-01-19 09:04:42 -08:00
dkao1978 eb9050ab90 Add documentation for compiling on MacOS (#89)
* Update README.md

* Update overview.md

* Update lib.rs

* Update README.md

* Add links
2017-10-22 11:17:35 +08:00
messense 703883687a
Add features to tests 2017-09-19 20:03:03 +08:00
messense 9da1247484
Fix build on rustc nightly-2017-09-16
Use forked version of spin-rs for now.

Closes #79
2017-09-19 19:51:25 +08:00
Nikolay Kim ed8599cfd3 refactor __new__ method implementation 2017-08-08 00:27:33 -07:00
Nikolay Kim 130c33ec09 export IntoPyDictPointer 2017-08-03 15:55:23 -07:00
Nikolay Kim cd6558a19b Introduce IntoPyDictPointer similar to IntoPyTuple #69 2017-08-03 15:01:52 -07:00
Nikolay Kim c44e23f4b9 add prelude mod 2017-07-31 10:42:55 -07:00
Nikolay Kim 325070f6c9 refactor downcast process 2017-07-28 23:19:00 -07:00
Nikolay Kim a4fd878cb7 pyerr cleanups 2017-07-26 14:28:04 -07:00
Nikolay Kim e45eb6e878 rename ToPyErr to PyErrArguments 2017-07-26 10:47:17 -07:00
Nikolay Kim a120bbf15e Refactor implementation. Drop parameter from constructor 2017-07-26 01:11:00 -07:00
Nikolay Kim 2ee6419464 do not catch rust panics 2017-07-20 14:21:57 -07:00
Nikolay Kim fc1df289bd drop PyClone trait; doc cleanups 2017-07-18 10:13:50 -07:00
Nikolay Kim 4daac50781 remove associated_consts feature 2017-07-14 03:17:57 -07:00
Nikolay Kim 8eb5dc0667 use associated consts 2017-07-13 16:45:50 -07:00
Nikolay Kim ed31492d36 rename pointer mod to object 2017-07-13 13:05:50 -07:00
Nikolay Kim c1c4648add delay decref until gil available 2017-07-09 12:08:57 +06:00
Nikolay Kim 503e4221cc support &str as fn param 2017-06-24 15:28:53 -07:00
messense 4e836cb229
Don't reexport Py_hash_t and Py_ssize_t 2017-06-24 22:36:45 +08:00
messense 378fae9659
Hide argparse module in API docs 2017-06-24 22:30:46 +08:00
messense a5e3429d60
Remove unnecessary ObjectProtocol import 2017-06-24 22:29:35 +08:00
messense 0ba541e762
Add missing module level docs 2017-06-24 16:47:36 +08:00
Nikolay Kim cc56ded6bf fix python2 extension module initialization 2017-06-23 11:51:15 -07:00
Nikolay Kim 61f85c730e fix doc tests; fix unsued import warning 2017-06-23 10:38:04 -07:00
Nikolay Kim a58aa7b5e6 rename PyObject 2017-06-22 20:56:09 -07:00
Nikolay Kim cb969161c6 fix unchecked downcast; added objects pool 2017-06-22 10:26:07 -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 7cf8e1ab80 modify PyDict 2017-06-21 14:08:16 -07:00
Nikolay Kim 96788bf192 more types 2017-06-21 13:10:40 -07:00
Nikolay Kim 08ddb3f14f other types 2017-06-21 12:33:21 -07:00
Nikolay Kim c4ba2b0f2e rename InstancePtr to AsPyRef 2017-06-20 14:22:49 -07:00
Nikolay Kim 40efa5c955 rename Ptr to Py 2017-06-19 23:57:34 -07:00
Nikolay Kim 7b5521fdb3 simplify instance ptr, droped #[py::ptr] annotation attr 2017-06-19 20:55:07 -07:00
Nikolay Kim b4deb673c7 refactor #[args()] attribute #40 2017-06-19 14:05:14 -07:00
Nikolay Kim 005c36548b add specialization to docs 2017-06-18 09:28:21 -07:00
messense 75d6684d25
Clarify Python module doc string 2017-06-18 23:15:10 +08:00
Nikolay Kim 60a965edc3 update link to example py extension 2017-06-15 14:30:11 -07:00
Nikolay Kim e85db971f9 fix module export functions 2017-06-15 14:20:30 -07:00
Nikolay Kim 0679fec859 update docs 2017-06-15 11:13:58 -07:00
Nikolay Kim ac0594a5b2 do not use pub pointers mod 2017-06-15 10:36:41 -07:00
Nikolay Kim 3bed79fe0b add clippy and doc to travis 2017-06-15 09:11:19 -07:00