From d65d87072b20a984bfae14e53ac3e77226875e1e Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Fri, 9 Sep 2016 16:39:12 -0400 Subject: [PATCH] use __Create__ as name for "constructors" instead of the object name so we call : Class.__Create__(...) to create a python object, instead of Class.Class(...) which seems duplicated and complicated if Class is long, e.g. "mEstimator_noiseModel_GemanMcClure" --- wrap/Constructor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrap/Constructor.cpp b/wrap/Constructor.cpp index 8cf0c7614..97e3fd2d5 100644 --- a/wrap/Constructor.cpp +++ b/wrap/Constructor.cpp @@ -137,8 +137,8 @@ void Constructor::emit_cython_pyx(FileWriter& pyxFile, const Class& cls) const { for (size_t i = 0; i < nrOverloads(); i++) { ArgumentList args = argumentList(i); pyxFile.oss << "\t@staticmethod\n"; - pyxFile.oss << "\tdef " << cls.cythonClassName() - << ((i > 0) ? "_" + to_string(i) : "") << "("; + pyxFile.oss << "\tdef __Create" + << ((i > 0) ? to_string(i) : "") << "__("; args.emit_cython_pyx(pyxFile); pyxFile.oss << "): \n"; pyxFile.oss << "\t\treturn " << cls.cythonClassName() << ".cyCreate("