Kaydet (Commit) 019f424a authored tarafından Guido van Rossum's avatar Guido van Rossum

More efficient handling of "__doc__" lookup.

üst f1d74134
......@@ -43,8 +43,14 @@ newclassobject(bases, dict, name)
#endif
classobject *op, *dummy;
static object *getattrstr, *setattrstr, *delattrstr;
if (dictlookup(dict, "__doc__") == NULL) {
if (dictinsert(dict, "__doc__", None) < 0)
static object *docstr;
if (docstr == NULL) {
docstr= newstringobject("__doc__");
if (docstr == NULL)
return NULL;
}
if (mappinglookup(dict, docstr) == NULL) {
if (mappinginsert(dict, docstr, None) < 0)
return NULL;
}
if (bases == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment