ariovistus avatar ariovistus committed 89fcc18

pruning unused things

Comments (0)

Files changed (4)

infrastructure/pyd/class_wrap.d

 
 // handle all operator overloads. Ops must only contain operator overloads.
 struct Operators(Ops...) {
-    pragma(msg, "Operators:",Ops.stringof);
     enum bool needs_shim = false;
 
     template BinOp(string op, T) {
         alias _T* T;
     }
     void wrap_class(string docstring="", string modulename="") {
-        pragma(msg, "shim.mangleof: " ~ shim_class.mangleof);
         alias wrapped_class_type!(T) type;
         //writefln("entering wrap_class for %s", typeid(T));
         //pragma(msg, "wrap_class, T is " ~ prettytypeof!(T));
         ////////////////////////
 
         Operators!(Filter!(IsOp, Params)).call!T();
-
         // its just that simple.
-        version(none) {
-            //old operator overloading. bye bye!
-            // Numerical operator overloads
-            if (pyd.op_wrap.wrapped_class_as_number!(T) != python.PyNumberMethods.init) {
-                type.tp_as_number = &pyd.op_wrap.wrapped_class_as_number!(T);
-            }
-            // Sequence operator overloads
-            if (pyd.op_wrap.wrapped_class_as_sequence!(T) != python.PySequenceMethods.init) {
-                type.tp_as_sequence = &pyd.op_wrap.wrapped_class_as_sequence!(T);
-            }
-            // Mapping operator overloads
-            if (pyd.op_wrap.wrapped_class_as_mapping!(T) != python.PyMappingMethods.init) {
-                type.tp_as_mapping = &pyd.op_wrap.wrapped_class_as_mapping!(T);
-            }
-
-            // Standard operator overloads
-            // opCmp
-            static if (is(typeof(&T.opCmp))) {
-                type.tp_compare = &pyd.op_wrap.opcmp_wrap!(T).func;
-            }
-            // opCall
-            static if (is(typeof(&T.opCall))) {
-                type.tp_call = cast(ternaryfunc)&method_wrap!(T, T.opCall, typeof(&T.opCall)).func;
-            }
-        }
 
         //////////////////////////
         // Constructor wrapping //

infrastructure/pyd/embedded.d

         handle_exception(file,line);
     }
 }
-/++
- + PyErr_Print() prints error messages to stderr,
- + but it is nicer in a string so we can stuff it in an Exception.
- + An instance of this class can be assigned to sys.stderr
- + to do just that. (we could use StringIO, but this is a nice demonstration
- + of Things We Can Do with Embedded Python):
--------
-Py_Initialize();
-add_module("pyd");
-ErrInterceptor.wrap_class("pyd");
-ErrInterceptor.replaceStderr();
-...
-PyEval("1 + 'a'");
--------
- +/
-class ErrInterceptor {
 
-    PydObject old_stderr;
-
-    this(PydObject obj) {
-        old_stderr = obj;
-    }
-    string _msg;
-    void write(string s) {
-        import std.stdio;
-        writeln("stderr: ",s);
-        _msg ~= s;
-        old_stderr.write(s);
-    }
-    void clear() {
-        _msg = "";
-    }
-    string msg(){
-        return _msg;
-    }
-
-    static void wrap_class(string modl) {
-        .wrap_class!(ErrInterceptor, 
-            Init!(void function(PydObject)),
-            Def!(ErrInterceptor.write),
-            Def!(ErrInterceptor.clear),
-            Def!(ErrInterceptor.msg))(
-            "A simple stream -> string utility implemented in D", // docstring
-            modl); // module name
-    }
-    static void replaceStderr() {
-        auto sys = py_import("sys");
-        sys.stderr = new ErrInterceptor(sys.stderr);
-    }
-    static string interceptStderr() {
-        auto z = PyErr_Occurred();
-        if(!z) {
-            import std.stdio;
-            writeln("no error occurred!");
-            return "";
-        }
-        string errmsg;
-        auto stderr = py_import("sys").stderr;
-        if(!stderr.hasattr("msg")) {
-            // whoops, stderr isn't ErrInterceptor
-            return z.toString();
-        }
-        PyErr_Print();
-        auto msg = stderr.method("msg");
-        if(msg != None) {
-            errmsg = msg.toDItem!string();
-        }
-        PyErr_Clear();
-        stderr.method("clear");
-        return errmsg;
-    }
-}

infrastructure/pyd/op_wrap.d

     ReturnType
 ;
 
-//import meta.Nameof;
-//import std.traits;
-
-version(Python_2_5_Or_Later) {
-    alias Py_ssize_t index_t;
-    alias lenfunc lenfunc_t;
-    alias ssizeargfunc idxargfunc;
-    alias ssizessizeargfunc idxidxargfunc;
-    alias ssizeobjargproc idxobjargproc;
-    alias ssizessizeobjargproc idxidxobjargproc;
-} else {
-    alias int index_t;
-    alias inquiry lenfunc_t;
-    alias ssizeargfunc idxargfunc;
-    alias ssizessizeargfunc idxidxargfunc;
-    alias ssizeobjargproc idxobjargproc;
-    alias ssizessizeobjargproc idxidxobjargproc;
-}
-
-// both __op__ and __rop__ are present.
-// use new style operator overloading (ie check which arg is actually self).
-template op_select(T, opl, opr) {
-    alias wrapped_class_type!T wtype;
-    alias opl.Inner!T .FN oplfn;
-    alias opr.Inner!T .FN oprfn;
-    extern(C)
-    PyObject* func(PyObject* o1, PyObject* o2) {
-        return exception_catcher(delegate PyObject*() {
-                enforce(is_wrapped!(T));
-                if (PyObject_IsInstance(o1, cast(PyObject*)&wtype)) {
-                    return opfunc_binary_wrap!(T, oplfn).func(o1, o2);
-                }else if(PyObject_IsInstance(o2, cast(PyObject*)&wtype)) {
-                    return opfunc_binary_wrap!(T, oprfn).func(o2, o1);
-                }else{
-                    enforce(false, format(
-                        "unsupported operand type(s) for %s: '%s' and '%s'",
-                        opl.op, to!string(o1.ob_type.tp_name), to!string(o2.ob_type.tp_name),
-                    ));
-                }
-        });
-    }
-}
-
 // wrap a binary operator overload, handling __op__, __rop__, or 
 // __op__ and __rop__ as necessary.
 // use new style operator overloading (ie check which arg is actually self).
     }
 }
 
-template wrapped_class_as_number(T) {
-    static PyNumberMethods wrapped_class_as_number = {
-        opAdd_wrap!(T),       /*nb_add*/
-        opSub_wrap!(T),       /*nb_subtract*/
-        opMul_wrap!(T),       /*nb_multiply*/
-        opDiv_wrap!(T),       /*nb_divide*/
-        opMod_wrap!(T),       /*nb_remainder*/
-        null,                 /*nb_divmod*/
-        null,                 /*nb_power*/
-        opNeg_wrap!(T),       /*nb_negative*/
-        opPos_wrap!(T),       /*nb_positive*/
-        null,                 /*nb_absolute*/
-        null,                 /*nb_nonzero*/
-        opCom_wrap!(T),       /*nb_invert*/
-        opShl_wrap!(T),       /*nb_lshift*/
-        opShr_wrap!(T),       /*nb_rshift*/
-        opAnd_wrap!(T),       /*nb_and*/
-        opXor_wrap!(T),       /*nb_xor*/
-        opOr_wrap!(T),        /*nb_or*/
-        null,                 /*nb_coerce*/
-        null,                 /*nb_int*/
-        null,                 /*nb_long*/
-        null,                 /*nb_float*/
-        null,                 /*nb_oct*/
-        null,                 /*nb_hex*/
-        opAddAssign_wrap!(T), /*nb_inplace_add*/
-        opSubAssign_wrap!(T), /*nb_inplace_subtract*/
-        opMulAssign_wrap!(T), /*nb_inplace_multiply*/
-        opDivAssign_wrap!(T), /*nb_inplace_divide*/
-        opModAssign_wrap!(T), /*nb_inplace_remainder*/
-        null,                 /*nb_inplace_power*/
-        opShlAssign_wrap!(T), /*nb_inplace_lshift*/
-        opShrAssign_wrap!(T), /*nb_inplace_rshift*/
-        opAndAssign_wrap!(T), /*nb_inplace_and*/
-        opXorAssign_wrap!(T), /*nb_inplace_xor*/
-        opOrAssign_wrap!(T),  /*nb_inplace_or*/
-        null,                 /* nb_floor_divide */
-        null,                 /* nb_true_divide */
-        null,                 /* nb_inplace_floor_divide */
-        null,                 /* nb_inplace_true_divide */
-    };
-}
-
-template wrapped_class_as_sequence(T) {
-    static PySequenceMethods wrapped_class_as_sequence = {
-        length_wrap!(T),                 /*sq_length*/
-        opCat_wrap!(T),                  /*sq_concat*/
-        null,                            /*sq_repeat*/
-        opIndex_sequence_wrap!(T),       /*sq_item*/
-        opSlice_wrap!(T),                /*sq_slice*/
-        opIndexAssign_sequence_wrap!(T), /*sq_ass_item*/
-        opSliceAssign_wrap!(T),          /*sq_ass_slice*/
-        opIn_wrap!(T),                   /*sq_contains*/
-        opCatAssign_wrap!(T),            /*sq_inplace_concat*/
-        null,                            /*sq_inplace_repeat*/
-    };
-}
-
-template wrapped_class_as_mapping(T) {
-    static PyMappingMethods wrapped_class_as_mapping = {
-        null,                           /*mp_length*/
-        opIndex_mapping_wrap!(T),       /*mp_subscript*/
-        opIndexAssign_mapping_wrap!(T), /*mp_ass_subscript*/
-    };
-}
-
 //----------------//
 // Implementation //
 //----------------//
-template opfunc_binary_wrap(T, alias opfn) {
-    pragma(msg, "opfn: ");
-    pragma(msg, __traits(identifier,opfn));
-    alias wrapped_class_object!(T) wrap_object;
-    alias ParameterTypeTuple!(opfn) Info;
-    pragma(msg, "info: ",Info);
-    alias ReturnType!(opfn) Ret;
-    alias dg_wrapper!(T, typeof(&opfn)) get_dg;
-    extern(C)
-    PyObject* func(PyObject* self, PyObject* o) {
-        return exception_catcher(delegate PyObject*() {
-            auto dg = get_dg((cast(wrap_object*)self).d_obj, &opfn);
-            pragma(msg, prettytypeof!(typeof(dg)));
-            pragma(msg, symbolnameof!(opfn));
-            static if (is(Ret == void)) {
-                dg(d_type!(Info[0])(o));
-                Py_INCREF(Py_None);
-                return Py_None;
-            } else {
-                return _py(
-                    dg(
-                        d_type!(Info[0])(o)
-                    )
-                );
-            }
-        });
-    }
-}
 
 template opfunc_unary_wrap(T, alias opfn) {
     extern(C)
     }
 }
 
-template opindex_sequence_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    
-    extern(C)
-    PyObject* func(PyObject* self, index_t i) {
-        return exception_catcher(delegate PyObject*() {
-            return _py((cast(wrap_object*)self).d_obj.opIndex(i));
-        });
-    }
-}
-
-template opindexassign_sequence_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    alias ParameterTypeTuple!(T.opIndexAssign) Info;
-    alias Info[0] AssignT;
-
-    extern(C)
-    int func(PyObject* self, index_t i, PyObject* o) {
-        return exception_catcher(delegate int() {
-            (cast(wrap_object*)self).d_obj.opIndexAssign(d_type!(AssignT)(o), i);
-            return 0;
-        });
-    }
-}
-
-template opindex_mapping_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    alias ParameterTypeTuple!(T.opIndex) Info;
-    enum uint ARGS = Info.length;
-
-    // Multiple arguments are converted into tuples, and thus become a standard
-    // wrapped member function call. A single argument is passed directly.
-    static if (ARGS == 1) {
-        alias Info[0] KeyT;
-        extern(C)
-        PyObject* func(PyObject* self, PyObject* key) {
-            return exception_catcher(delegate PyObject*() {
-                return _py((cast(wrap_object*)self).d_obj.opIndex(d_type!(KeyT)(key)));
-            });
-        }
-    } else {
-        alias method_wrap!(T, T.opIndex, typeof(&T.opIndex)) opindex_methodT;
-        extern(C)
-        PyObject* func(PyObject* self, PyObject* key) {
-            Py_ssize_t args;
-            if (!PyTuple_CheckExact(key)) {
-                args = 1;
-            } else {
-                args = PySequence_Length(key);
-            }
-            if (ARGS != args) {
-                setWrongArgsError(args, ARGS, ARGS);
-                return null;
-            }
-            return opindex_methodT.func(self, key);
-        }
-    }
-}
-
 template opindex_wrap(T, alias fn) {
     alias wrapped_class_object!(T) wrap_object;
     alias ParameterTypeTuple!fn Params;
     }
 }
 
-template opindexassign_mapping_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    alias ParameterTypeTuple!(T.opIndexAssign) Info;
-    enum uint ARGS = Info.length;
-
-    static if (ARGS > 2) {
-        extern(C)
-        int func(PyObject* self, PyObject* key, PyObject* val) {
-            Py_ssize_t args;
-            if (!PyTuple_CheckExact(key)) {
-                args = 2;
-            } else {
-                args = PySequence_Length(key) + 1;
-            }
-            if (ARGS != args) {
-                setWrongArgsError(args, ARGS, ARGS);
-                return -1;
-            }
-            // Build a new tuple with the value at the front.
-            PyObject* temp = PyTuple_New(ARGS);
-            if (temp is null) return -1;
-            scope(exit) Py_DECREF(temp);
-            PyTuple_SetItem(temp, 0, val);
-            for (int i=1; i<ARGS; ++i) {
-                Py_INCREF(PyTuple_GetItem(key, i-1));
-                PyTuple_SetItem(temp, i, PyTuple_GetItem(key, i-1));
-            }
-            method_wrap!(T, T.opIndexAssign, typeof(&T.opIndexAssign)).func(self, temp);
-            return 0;
-        }
-    } else {
-        alias Info[0] ValT;
-        alias Info[1] KeyT;
-
-        extern(C)
-        int func(PyObject* self, PyObject* key, PyObject* val) {
-            return exception_catcher(delegate int() {
-                (cast(wrap_object*)self).d_obj.opIndexAssign(d_type!(ValT)(val), d_type!(KeyT)(key));
-                return 0;
-            });
-        }
-    }
-}
-
-template opslice_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    alias dg_wrapper!(T, typeof(&lfn)) get_dg;
-
-    extern(C)
-    PyObject* func(PyObject* self, index_t i1, index_t i2) {
-        return exception_catcher(delegate PyObject*() {
-            auto dg = get_dgl((cast(wrap_object*)self).d_obj, &fn);
-            return _py(dg(i1, i2));
-        });
-    }
-}
-
-template opsliceassign_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-    alias ParameterTypeTuple!(T.opSliceAssign) Info;
-    alias Info[0] AssignT;
-
-    extern(C)
-    int func(PyObject* self, index_t i1, index_t i2, PyObject* o) {
-        return exception_catcher(delegate int() {
-            (cast(wrap_object*)self).d_obj.opSliceAssign(d_type!(AssignT)(o), i1, i2);
-            return 0;
-        });
-    }
-}
-
 template inop_wrap(T, _lop, _rop) {
     alias _rop.C rop;
     alias wrapped_class_object!(T) wrap_object;
     }
 }
 
-template length_pyfunc(T) {
-    alias wrapped_class_object!(T) wrap_object;
-
-    extern(C)
-    index_t func(PyObject* self) {
-        return exception_catcher(delegate int() {
-            return (cast(wrap_object*)self).d_obj.length();
-        });
-    }
-}
-
 //----------//
 // Dispatch //
 //----------//
     }
 }
 
-template opIndex_sequence_wrap(T) {
-    static if (
-        is(typeof(&T.opIndex)) &&
-        ParameterTypeTuple!(T.opIndex).length == 1 &&
-        is(ParameterTypeTuple!(T.opIndex)[0] : index_t)
-    ) {
-        enum idxargfunc opIndex_sequence_wrap = &opindex_sequence_pyfunc!(T).func;
-    } else {
-        enum idxargfunc opIndex_sequence_wrap = null;
-    }
-}
-
-template opIndexAssign_sequence_wrap(T) {
-    static if (
-        is(typeof(&T.opIndexAssign)) &&
-        ParameterTypeTuple!(T.opIndexAssign).length == 2 &&
-        is(ParameterTypeTuple!(T.opIndexAssign)[1] : index_t)
-    ) {
-        enum idxobjargproc opIndexAssign_sequence_wrap = &opindexassign_sequence_pyfunc!(T).func;
-    } else {
-        enum idxobjargproc opIndexAssign_sequence_wrap = null;
-    }
-}
-
-template opIndex_mapping_wrap(T) {
-    static if (
-        is(typeof(&T.opIndex)) &&
-        (ParameterTypeTuple!(T.opIndex).length > 1 ||
-        !is(ParameterTypeTuple!(T.opIndex)[0] : index_t))
-    ) {
-        enum binaryfunc opIndex_mapping_wrap = &opindex_mapping_pyfunc!(T).func;
-    } else {
-        enum binaryfunc opIndex_mapping_wrap = null;
-    }
-}
-
-template opIndexAssign_mapping_wrap(T) {
-    static if (
-        is(typeof(&T.opIndexAssign)) &&
-        (ParameterTypeTuple!(T.opIndex).length > 2 ||
-        !is(ParameterTypeTuple!(T.opIndex)[1] : index_t))
-    ) {
-        enum objobjargproc opIndexAssign_mapping_wrap = &opindexassign_mapping_pyfunc!(T).func;
-    } else {
-        enum objobjargproc opIndexAssign_mapping_wrap = null;
-    }
-}
-
-template opSlice_wrap(T) {
-    static if (
-        is(typeof(&T.opSlice)) &&
-        ParameterTypeTuple!(T.opSlice).length == 2 &&
-        is(ParameterTypeTuple!(T.opSlice)[0] : index_t) &&
-        is(ParameterTypeTuple!(T.opSlice)[1] : index_t)
-    ) {
-        enum idxidxargfunc opSlice_wrap = &opslice_pyfunc!(T).func;
-    } else {
-        enum idxidxargfunc opSlice_wrap = null;
-    }
-}
-
 template opslice_wrap(T,alias fn) {
     alias wrapped_class_object!(T) wrap_object;
     alias dg_wrapper!(T, typeof(&fn)) get_dg;
     extern(C)
-    PyObject* func(PyObject* self, index_t i1, index_t i2) {
+    PyObject* func(PyObject* self, Py_ssize_t i1, Py_ssize_t i2) {
         return exception_catcher(delegate PyObject*() {
             auto dg = get_dg((cast(wrap_object*)self).d_obj, &fn);
             return _py(dg(i1, i2));
     }
 }
 
-template opSliceAssign_wrap(T) {
-    static if (
-        is(typeof(&T.opSlice)) &&
-        ParameterTypeTuple!(T.opSlice).length == 3 &&
-        is(ParameterTypeTuple!(T.opSlice)[1] : index_t) &&
-        is(ParameterTypeTuple!(T.opSlice)[2] : index_t)
-    ) {
-        enum idxidxobjargproc opSliceAssign_wrap = &opsliceassign_pyfunc!(T).func;
-    } else {
-        enum idxidxobjargproc opSliceAssign_wrap = null;
-    }
-}
-
-template opAdd_wrap(T) {
-    static if (is(typeof(&T.opAdd))) {
-        enum binaryfunc opAdd_wrap = &opfunc_binary_wrap!(T, T.opAdd).func;
-    } else {
-        enum binaryfunc opAdd_wrap = null;
-    }
-}
-
-template opSub_wrap(T) {
-    static if (is(typeof(&T.opSub))) {
-        enum binaryfunc opSub_wrap = &opfunc_binary_wrap!(T, T.opSub).func;
-    } else {
-        enum binaryfunc opSub_wrap = null;
-    }
-}
-
-
-template opMul_wrap(T) {
-    static if (is(typeof(&T.opMul))) {
-        enum binaryfunc opMul_wrap = &opfunc_binary_wrap!(T, T.opMul).func;
-    } else {
-        enum binaryfunc opMul_wrap = null;
-    }
-}
-
-
-template opDiv_wrap(T) {
-    static if (is(typeof(&T.opDiv))) {
-        enum binaryfunc opDiv_wrap = &opfunc_binary_wrap!(T, T.opDiv).func;
-    } else {
-        enum binaryfunc opDiv_wrap = null;
-    }
-}
-
-
-template opMod_wrap(T) {
-    static if (is(typeof(&T.opMod))) {
-        enum binaryfunc opMod_wrap = &opfunc_binary_wrap!(T, T.opMod).func;
-    } else {
-        enum binaryfunc opMod_wrap = null;
-    }
-}
-
-
-template opAnd_wrap(T) {
-    static if (is(typeof(&T.opAnd))) {
-        enum binaryfunc opAnd_wrap = &opfunc_binary_wrap!(T, T.opAnd).func;
-    } else {
-        enum binaryfunc opAnd_wrap = null;
-    }
-}
-
-
-template opOr_wrap(T) {
-    static if (is(typeof(&T.opOr))) {
-        enum binaryfunc opOr_wrap = &opfunc_binary_wrap!(T, T.opOr).func;
-    } else {
-        enum binaryfunc opOr_wrap = null;
-    }
-}
-
-
-template opXor_wrap(T) {
-    static if (is(typeof(&T.opXor))) {
-        enum binaryfunc opXor_wrap = &opfunc_binary_wrap!(T, T.opXor).func;
-    } else {
-        enum binaryfunc opXor_wrap = null;
-    }
-}
-
-
-template opShl_wrap(T) {
-    static if (is(typeof(&T.opShl))) {
-        enum binaryfunc opShl_wrap = &opfunc_binary_wrap!(T, T.opShl).func;
-    } else {
-        enum binaryfunc opShl_wrap = null;
-    }
-}
-
-
-template opShr_wrap(T) {
-    static if (is(typeof(&T.opShr))) {
-        enum binaryfunc opShr_wrap = &opfunc_binary_wrap!(T, T.opShr).func;
-    } else {
-        enum binaryfunc opShr_wrap = null;
-    }
-}
-
-
-template opUShr_wrap(T) {
-    static if (is(typeof(&T.opUShr))) {
-        enum binaryfunc opUShr_wrap = &opfunc_binary_wrap!(T, T.opUShr).func;
-    } else {
-        enum binaryfunc opUShr_wrap = null;
-    }
-}
-
-
-template opCat_wrap(T) {
-    static if (is(typeof(&T.opCat))) {
-        enum binaryfunc opCat_wrap = &opfunc_binary_wrap!(T, T.opCat).func;
-    } else {
-        enum binaryfunc opCat_wrap = null;
-    }
-}
-
-
-template opAddAssign_wrap(T) {
-    static if (is(typeof(&T.opAddAssign))) {
-        enum binaryfunc opAddAssign_wrap = &opfunc_binary_wrap!(T, T.opAddAssign).func;
-    } else {
-        enum binaryfunc opAddAssign_wrap = null;
-    }
-}
-
-
-template opSubAssign_wrap(T) {
-    static if (is(typeof(&T.opSubAssign))) {
-        enum binaryfunc opSubAssign_wrap = &opfunc_binary_wrap!(T, T.opSubAssign).func;
-    } else {
-        enum binaryfunc opSubAssign_wrap = null;
-    }
-}
-
-
-template opMulAssign_wrap(T) {
-    static if (is(typeof(&T.opMulAssign))) {
-        enum binaryfunc opMulAssign_wrap = &opfunc_binary_wrap!(T, T.opMulAssign).func;
-    } else {
-        enum binaryfunc opMulAssign_wrap = null;
-    }
-}
-
-
-template opDivAssign_wrap(T) {
-    static if (is(typeof(&T.opDivAssign))) {
-        enum binaryfunc opDivAssign_wrap = &opfunc_binary_wrap!(T, T.opDivAssign).func;
-    } else {
-        enum binaryfunc opDivAssign_wrap = null;
-    }
-}
-
-
-template opModAssign_wrap(T) {
-    static if (is(typeof(&T.opModAssign))) {
-        enum binaryfunc opModAssign_wrap = &opfunc_binary_wrap!(T, T.opModAssign).func;
-    } else {
-        enum binaryfunc opModAssign_wrap = null;
-    }
-}
-
-
-template opAndAssign_wrap(T) {
-    static if (is(typeof(&T.opAndAssign))) {
-        enum binaryfunc opAndAssign_wrap = &opfunc_binary_wrap!(T, T.opAndAssign).func;
-    } else {
-        enum binaryfunc opAndAssign_wrap = null;
-    }
-}
-
-
-template opOrAssign_wrap(T) {
-    static if (is(typeof(&T.opOrAssign))) {
-        enum binaryfunc opOrAssign_wrap = &opfunc_binary_wrap!(T, T.opOrAssign).func;
-    } else {
-        enum binaryfunc opOrAssign_wrap = null;
-    }
-}
-
-
-template opXorAssign_wrap(T) {
-    static if (is(typeof(&T.opXorAssign))) {
-        enum binaryfunc opXorAssign_wrap = &opfunc_binary_wrap!(T, T.opXorAssign).func;
-    } else {
-        enum binaryfunc opXorAssign_wrap = null;
-    }
-}
-
-
-template opShlAssign_wrap(T) {
-    static if (is(typeof(&T.opShlAssign))) {
-        enum binaryfunc opShlAssign_wrap = &opfunc_binary_wrap!(T, T.opShlAssign).func;
-    } else {
-        enum binaryfunc opShlAssign_wrap = null;
-    }
-}
-
-
-template opShrAssign_wrap(T) {
-    static if (is(typeof(&T.opShrAssign))) {
-        enum binaryfunc opShrAssign_wrap = &opfunc_binary_wrap!(T, T.opShrAssign).func;
-    } else {
-        enum binaryfunc opShrAssign_wrap = null;
-    }
-}
-
-
-template opUShrAssign_wrap(T) {
-    static if (is(typeof(&T.opUShrAssign))) {
-        enum binaryfunc opUShrAssign_wrap = &opfunc_binary_wrap!(T, T.opUShrAssign).func;
-    } else {
-        enum binaryfunc opUShrAssign_wrap = null;
-    }
-}
-
-
-template opCatAssign_wrap(T) {
-    static if (is(typeof(&T.opCatAssign))) {
-        enum binaryfunc opCatAssign_wrap = &opfunc_binary_wrap!(T, T.opCatAssign).func;
-    } else {
-        enum binaryfunc opCatAssign_wrap = null;
-    }
-}
-
-
-template opIn_wrap(T) {
-    static if (is(typeof(&T.opIn_r))) {
-        enum objobjproc opIn_wrap = &opin_wrap.func;
-    } else {
-        enum objobjproc opIn_wrap = null;
-    }
-}
-
-template opNeg_wrap(T) {
-    static if (is(typeof(&T.opNeg))) {
-        enum unaryfunc opNeg_wrap = &opfunc_unary_wrap!(T, T.opNeg).func;
-    } else {
-        enum unaryfunc opNeg_wrap = null;
-    }
-}
-
-template opPos_wrap(T) {
-    static if (is(typeof(&T.opPos))) {
-        enum unaryfunc opPos_wrap = &opfunc_unary_wrap!(T, T.opPos).func;
-    } else {
-        enum unaryfunc opPos_wrap = null;
-    }
-}
-
-template opCom_wrap(T) {
-    static if (is(typeof(&T.opCom))) {
-        enum unaryfunc opCom_wrap = &opfunc_unary_wrap!(T, T.opCom).func;
-    } else {
-        enum unaryfunc opCom_wrap = null;
-    }
-}
-
 Welcome to Pyd!
 
+Pyd is currently under development, and is in the middle of API 
+changes (https://bitbucket.org/ariovistus/pyd/wiki/Changes)
+
 This package is composed of two separate parts:
 
   * CeleriD - An extension to Python's Distutils that is aware of D.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.