Changes to the API that ensure consistency across the various platforms that pyd intends to support are on the table. Otherwise, we will try to avoid change.
Older API Changes
Since Pyd was originally written, D has evolved into a much more formidable language. For this and other reasons, the following changes have been made to Pyd's API:
It was automatic. It is now explicit.
Reflected operator overloading is now supported.
See Class Wrapping for details.
Init parameters were once written
Init!(void function(int), void function(double, double))
Now they are written
Init!(int), Init!(double, double)
def no longer has a MIN_ARGS param, and the parameters of def and most of the parameters of class_wrap have changed to a keyword style.
def(modulename, fn, pyname, fn_t)(docstring);
def(fn, PyName!pyname, fn_t, ModuleName!modulename, Docstring!docstring)();
- fn must be the first argument; otherwise order of parameters does not matter.
- fn_t is not wrapped by a template.
All function wrapping utilities now support default arguments and typesafe variadic arguments. Wrapped functions may now be called in python with keyword arguments.
conversion functions have been renamed.
Many functions in pyd have been renamed to enforce the following naming convention:
- functions: lowercase_with_underscores
- templates, classes, etc: CamelCase