mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
Added __dict__ attributes all over the place.
This commit is contained in:
parent
e0e5edcb6e
commit
85f5076962
@ -1039,12 +1039,18 @@ text_getattr(tp, name)
|
|||||||
textobject *tp;
|
textobject *tp;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
if (tp->t_attr != NULL) {
|
object *v = NULL;
|
||||||
object *v = dictlookup(tp->t_attr, name);
|
if (strcmp(name, "__dict__") == 0) {
|
||||||
if (v != NULL) {
|
v = tp->t_attr;
|
||||||
INCREF(v);
|
if (v == NULL)
|
||||||
return v;
|
v = None;
|
||||||
}
|
}
|
||||||
|
else if (tp->t_attr != NULL) {
|
||||||
|
v = dictlookup(tp->t_attr, name);
|
||||||
|
}
|
||||||
|
if (v != NULL) {
|
||||||
|
INCREF(v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
return findmethod(text_methods, (object *)tp, name);
|
return findmethod(text_methods, (object *)tp, name);
|
||||||
}
|
}
|
||||||
@ -1217,12 +1223,18 @@ menu_getattr(mp, name)
|
|||||||
menuobject *mp;
|
menuobject *mp;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
if (mp->m_attr != NULL) {
|
object *v = NULL;
|
||||||
object *v = dictlookup(mp->m_attr, name);
|
if (strcmp(name, "__dict__") == 0) {
|
||||||
if (v != NULL) {
|
v = mp->m_attr;
|
||||||
INCREF(v);
|
if (v == NULL)
|
||||||
return v;
|
v = None;
|
||||||
}
|
}
|
||||||
|
else if (mp->m_attr != NULL) {
|
||||||
|
v = dictlookup(mp->m_attr, name);
|
||||||
|
}
|
||||||
|
if (v != NULL) {
|
||||||
|
INCREF(v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
return findmethod(menu_methods, (object *)mp, name);
|
return findmethod(menu_methods, (object *)mp, name);
|
||||||
}
|
}
|
||||||
@ -1575,12 +1587,18 @@ window_getattr(wp, name)
|
|||||||
windowobject *wp;
|
windowobject *wp;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
if (wp->w_attr != NULL) {
|
object *v = NULL;
|
||||||
object *v = dictlookup(wp->w_attr, name);
|
if (strcmp(name, "__dict__") == 0) {
|
||||||
if (v != NULL) {
|
v = wp->w_attr;
|
||||||
INCREF(v);
|
if (v == NULL)
|
||||||
return v;
|
v = None;
|
||||||
}
|
}
|
||||||
|
else if (wp->w_attr != NULL) {
|
||||||
|
v = dictlookup(wp->w_attr, name);
|
||||||
|
}
|
||||||
|
if (v != NULL) {
|
||||||
|
INCREF(v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
return findmethod(window_methods, (object *)wp, name);
|
return findmethod(window_methods, (object *)wp, name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user