Commit Graph

53 Commits

Author SHA1 Message Date
Nikolay Kim e44365bec6 make cast_xxx api consistent with PyObject::from_xxx api 2017-08-01 14:29:25 -07:00
Nikolay Kim 325070f6c9 refactor downcast process 2017-07-28 23:19:00 -07:00
Nikolay Kim 8227ce81e2 various cleanups 2017-07-26 20:29:07 -07:00
Nikolay Kim a120bbf15e Refactor implementation. Drop parameter from constructor 2017-07-26 01:11:00 -07:00
Nikolay Kim a00ae1757c add PyDict keys,values,items methods 2017-07-20 08:23:43 -07:00
Nikolay Kim f344c4ce3d added try downcast methods to PyDowncastFrom trait 2017-07-19 13:01:59 -07:00
messense e69163344a Fix some clippy warnings (#49) 2017-07-18 19:28:49 +08:00
Nikolay Kim fb8b32072f add basic args test 2017-07-13 18:50:34 -07:00
Nikolay Kim a90d8c241f fix ref counter for get_kwargs 2017-07-04 10:24:04 +06:00
Nikolay Kim 503e4221cc support &str as fn param 2017-06-24 15:28:53 -07:00
Nikolay Kim 3a2004eab2 rename PyInstance to PyObjectRef 2017-06-24 08:28:31 -07:00
messense 0ba541e762
Add missing module level docs 2017-06-24 16:47:36 +08:00
Nikolay Kim a58aa7b5e6 rename PyObject 2017-06-22 20:56:09 -07:00
Nikolay Kim 00bd5615ed drop py paramater for protcol definitions 2017-06-22 12:32:01 -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 bc0f9b014f convert PyString object 2017-06-20 23:27:30 -07:00
Nikolay Kim 40efa5c955 rename Ptr to Py 2017-06-19 23:57:34 -07:00
Nikolay Kim 706477f139 replace py_fn! macro with pyfn attribute 2017-06-14 14:08:30 -07:00
Nikolay Kim 319ee30c79 new impl for #[args] attribute 2017-06-13 22:37:26 -07: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 b75160daf3 remove pyobject lifetime 2017-06-02 18:58:16 -07:00
Nikolay Kim 61b8bd0695 fix ptr borrowing PyTuple::get_item 2017-05-29 18:36:44 -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
Nikolay Kim 6c87c9b77b introduce python token system 2017-05-27 22:45:48 -07:00
Nikolay Kim d165dbe4d4 fixed gil lifetime; pass py object into protocol methods 2017-05-26 14:43:28 -07:00
Nikolay Kim f3176dacfc use pyptr for everything 2017-05-25 08:06:06 -07:00
messense 4c802d901b
More generic `new` method for PyList/PyTuple and etc. 2017-05-21 14:00:41 +08:00
Nikolay Kim 04168ab86e added fn spec for args parsing 2017-05-18 00:05:49 -07:00
Nikolay Kim 521a91fbc2 remove unused imports 2017-05-16 14:18:31 -07:00
Nikolay Kim 5427a33c75 stopping point 2017-05-15 22:24:06 -07:00
Nikolay Kim 088d44f8d1 simplify ToPyObject trait 2017-05-14 14:42:56 -07:00
Daniel Grunwald e638b2654a Avoid Rust->Python->Rust roundtrip when using default value in argparse! optional parameter with reference extraction. 2017-01-27 23:21:57 +01:00
Daniel Grunwald 32e0d35603 Update documentation 2017-01-27 21:52:04 +01:00
Luthaf d615c319f6 Implement optional parameters for reference types 2017-01-26 21:35:16 +01:00
Guillaume Fraux 9707c5ab72 Implement optional values in argparse 2017-01-26 21:19:38 +01:00
Tibor Benke ca6bd439ae Correct documentation by replacing ExtractPyObject with FromPyObject
Signed-off-by: Tibor Benke <tibor.benke@balabit.com>
2016-07-28 23:56:35 +02:00
Daniel Grunwald 0222176836 #40: split ExtractPyObject into two traits:
* FromPyObject for all conversions that don't need to borrow temporaries
* RefFromPyObject for extracting references out of temporaries
  (currently only used for extracting `&str`)
2016-05-08 21:25:09 +02:00
Daniel Grunwald b37fa220df On Python 2.7, PyString now corresponds to `basestring` instead of `str`.
`<str as ToPyObject>::ObjectType` now always is `PyString`
  (previously the type differed between Python 2.7 and 3.x)

`PyStringData` allows zero-copy access to Python's underlying string
representation.
2016-05-05 07:26:52 +02:00
Daniel Grunwald 0bd9e3ebd2 Adjust extension test cases. 2016-03-12 18:14:21 +01:00
Daniel Grunwald 9b278ba56b Implement second form of py_fn!() (inline function definition) 2016-03-07 23:48:44 +01:00
Daniel Grunwald 3af6e17841 WIP: big macro refactoring
* Introduce py_argparse_parse_plist!() to allow a more flexible
  param list syntax.
* py_fn!() syntax changed
* Remove py_method!() / py_class_method!() macros.
  These are of limited use when building dynamic types,
  and not useful for py_class!() static types.
2016-03-07 23:22:44 +01:00
Daniel Grunwald be682d848f WIP: generalize py_argparse!() macro 2016-03-06 13:33:57 +01:00
Daniel Grunwald 067f262876 Some documentation updates 2016-03-05 17:41:04 +01:00
Daniel Grunwald c1682b68ac Add some tests for py_fn!() 2015-11-07 16:52:20 +01:00
Daniel Grunwald 0a270a0583 Put Python argument at beginning of argument list.
Closes #33.
2015-10-26 23:52:18 +01:00