void buildFunctionType() {
Scope t = BaseFunction.getTable();
for (String s : list("func_doc", "__doc__", "func_name", "__name__", "__module__")) {
t.update(s, new NUrl(DATAMODEL_URL), BaseStr, ATTRIBUTE);
}
NBinding b = synthetic(t, "func_closure", new NUrl(DATAMODEL_URL), newTuple(), ATTRIBUTE);
b.markReadOnly();
synthetic(t, "func_code", new NUrl(DATAMODEL_URL), unknown(), ATTRIBUTE);
synthetic(t, "func_defaults", new NUrl(DATAMODEL_URL), newTuple(), ATTRIBUTE);
synthetic(t, "func_globals", new NUrl(DATAMODEL_URL),
new NDictType(BaseStr, new NUnknownType()), ATTRIBUTE);
synthetic(t, "func_dict", new NUrl(DATAMODEL_URL),
new NDictType(BaseStr, new NUnknownType()), ATTRIBUTE);
// Assume any function can become a method, for simplicity.
for (String s : list("__func__", "im_func")) {
synthetic(t, s, new NUrl(DATAMODEL_URL), new NFuncType(), METHOD);
}
}