From f5691804ed3d38e8294ac10c53f001ad222ba132 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Mon, 19 Sep 2016 12:39:04 -0400 Subject: [PATCH] Use class name as ctor for static construction calls Longer, but more conventional --- wrap/Constructor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrap/Constructor.cpp b/wrap/Constructor.cpp index a116627e2..9c4d3fc02 100644 --- a/wrap/Constructor.cpp +++ b/wrap/Constructor.cpp @@ -147,8 +147,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 ctor" - << ((i > 0) ? to_string(i) : "") << "("; + pyxFile.oss << "\tdef " << name_ + << ((i > 0) ? "_" + to_string(i) : "") << "("; args.emit_cython_pyx(pyxFile); pyxFile.oss << "): \n";