Source

pyd / examples / pyd_unittests / make_object.d

Author Commit Message Labels Comments Date
ariovistus
fix pydexe link for python3 runtests.py works for python3 now! fix link unittest for python3
ariovistus
apparently conversion for delegates and fps didn't work. now it does. added some playing with multithreading and pyd. seems not to die too horribly.
ariovistus
implement extending embedded python 3. it is slightly different than python2, but we seem to have both working. tp_compare goes away in python 3, so we now use tp_richcompare for both 2 and 3 sq_slice, sq_ass_slice go away in python 3, which favors the extended slicing api only. python 2 supports it too, so we'll implement it here in a jiffy. pyd.embedded no longer calls py_init, because now where to call add_module and friends is now python-version-dependent. Use of on_py_init is necessary. pyind3 is working at least!
ariovistus
switched pyd to use deimos headers. calling substitute_and_alias broke link, so it's out (sort of). embedding python works! fixed some holdovers in deimos.python.object
ariovistus
update d <-> python string conversion to actually use utf encodings. unicode is the python string type of choice now. improved exception messages (ex's __unicode__ tends to know what to do better than I do) python.d was not properly linking some PyUnicode functions, so I wrote a function to simulate the C preprocessor. It's really slow.
ariovistus
added d -> array.array conversion. moved numpy.ndarray conversion to pyd.extra.
ariovistus
added d -> python for numpy.ndarray. maybe doesn't belong, but it wasn't too complicated.
ariovistus
conversion d ranges <-> python iterators now supported required wrapping a type. so now module 'pyd' exists. come to think of it, this will be murder on multiple extension modules. oh well. Py_XINCREF isn't supposed to throw for non borrowed types changed py_def to take function type rather than return type and arg types
ariovistus
renamed conversion functions. d_type is now python_to_d _py is now d_to_python PydObject.toDItem is now PydObject.to_d python_to_d is now ex_python_to_d d_to_python is now ex_d_to_python parrot is now ex_parrot now enforcing naming convention on pyd: * public facing functions are named like this: foo_bar * types and templates are named like this: FooBar changed…
ariovistus
added some unittests for bytearray, which is a buffer.
ariovistus
New style buffer interface is supported! we have a wrapper around the interface in PydObject.bufferview we have support for for python -> d conversion, for nd arrays (still have to deal with simple buffers) this translates to (hopefully) much faster conversion from e.g. numpy.ndarray to d arrays, but more restrictions on what types can be converted, e.g. numpy ieee754 binary64 matrix to int[][] is not allowed. trying out scons for…
ariovistus
doh! Py_buffer got a new field in 2.7 improve make_object docs add some unittests for python_to_d, d_to_python
ariovistus
more improvements to d_type * fix d_type for null arrays (which aren't really null) * implemented PydInputRange * fix PyEval, PyStmts: don't need to give a module for builtins * replace PyObject_BorrowedRef with template * fix PyEval_GetBuiltins and friends: they return borrowed refs!
ariovistus
improvements to d_type * fix d_type failure to convert python int objects * improve d_type handling of d arrays * add special case to d_type for python's array.array -todo: finish special case for new style buffer interface * let could_not_convert display reason for failure. * some fixes to python.d * added arrayobject to python.d (it doesn't really belong in there, but it probably isn't going to change)
ariovistus
conversion to/fro BigInt now handled. poorly handled: uses string intermediate representation. BigInt won't let you touch its bits. Oh well.
ariovistus
Init now supports default arguments and typesafe variadic arguments. improvement to Replace: favor longer replacees if ambiguity hello Join! moved unittests in pyind to dedicated pyd_unittests.