mirror of https://github.com/exaloop/codon.git
Add pyext support for @tuple.__new__
parent
3e1a9a8a35
commit
9ef321ca4a
|
@ -334,8 +334,10 @@ void Cache::populatePythonModule() {
|
|||
std::string call = pyWrap + ".wrap_multiple";
|
||||
bool isMagic = false;
|
||||
if (startswith(n, "__") && endswith(n, "__")) {
|
||||
if (auto i = in(classes[pyWrap].methods,
|
||||
"wrap_magic_" + n.substr(2, n.size() - 4))) {
|
||||
auto m = n.substr(2, n.size() - 4);
|
||||
if (m == "new" && c.ast->hasAttr(Attr::Tuple))
|
||||
m = "init";
|
||||
if (auto i = in(classes[pyWrap].methods, "wrap_magic_" + m)) {
|
||||
call = *i;
|
||||
isMagic = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue