bertiniteam / b2

Bertini 2.0: The redevelopment of Bertini in C++.
90 stars 34 forks source link

eliminate boilerplate for naming submodules in pybertini #139

Open ofloveandhate opened 6 years ago

ofloveandhate commented 6 years ago

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: