b2 icon indicating copy to clipboard operation
b2 copied to clipboard

eliminate boilerplate for naming submodules in pybertini

Open ofloveandhate opened this issue 7 years ago • 0 comments

this sucks:

scope current_scope;
std::string new_submodule_name(extract<const char*>(current_scope.attr("__name__")));
new_submodule_name.append(".config");
object new_submodule(borrowed(PyImport_AddModule(new_submodule_name.c_str())));
current_scope.attr("config") = new_submodule;

scope new_submodule_scope = new_submodule;

replace it with a macro or something. this appears like 15 or more times in the pybertini c++ codebase. eww. :nauseated_face:

ofloveandhate avatar Feb 11 '18 00:02 ofloveandhate