mirror of https://github.com/KLayout/klayout.git
adding __rmul__ in all objects with __mul__
This commit is contained in:
parent
98d66725eb
commit
568035cdd6
|
|
@ -2698,6 +2698,11 @@ PythonModule::make_classes (const char *mod_name)
|
||||||
add_python_doc (*c, mt, mid, tl::to_string (tr ("This method enables iteration of the object")));
|
add_python_doc (*c, mt, mid, tl::to_string (tr ("This method enables iteration of the object")));
|
||||||
alt_names.push_back ("__iter__");
|
alt_names.push_back ("__iter__");
|
||||||
|
|
||||||
|
} else if (name == "__mul__") {
|
||||||
|
// Adding right multiplication
|
||||||
|
// Rationale: if pyaObj * x works, so should x * pyaObj
|
||||||
|
add_python_doc (*c, mt, mid, tl::to_string (tr ("This method is also available as '__mul__'")));
|
||||||
|
alt_names.push_back ("__rmul__");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector <std::string>::const_iterator an = alt_names.begin (); an != alt_names.end (); ++an) {
|
for (std::vector <std::string>::const_iterator an = alt_names.begin (); an != alt_names.end (); ++an) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue