Merge pull request #389 from KLayout/issue-386

Fixed issue #386 by mapping 'None' to 'None_' in Python
This commit is contained in:
Matthias Köfferlein 2019-11-06 01:00:58 +01:00 committed by GitHub
commit b920e057a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -451,7 +451,8 @@ static bool is_reserved_word (const std::string &name)
name == "def" ||
name == "for" ||
name == "lambda" ||
name == "try");
name == "try" ||
name == "None");
}
/**
@ -2641,7 +2642,7 @@ PythonModule::make_classes (const char *mod_name)
}
if (name != raw_name) {
add_python_doc (**c, mt, int (mid), tl::sprintf (tl::to_string (tr ("This method is available as method '%s' in Python")), name));
add_python_doc (**c, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name));
}
// create documentation
@ -2741,7 +2742,7 @@ PythonModule::make_classes (const char *mod_name)
} else if (tl::verbosity () >= 20) {
tl::warn << "Upper case method name encountered which cannot be used as a Python constant (more than one overload or at least one argument): " << (*c)->name () << "." << name;
add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method is not available for Python")));
add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This attribute is not available for Python")));
}
} else {