mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
* classobject.c: in instance_getattr, don't make a method out of a
function found as instance data. * socketmodule.c: added 'flags' argument sendto/recvfrom, rewrite argument parsing in send/recv. * More changes related to access (terminology change: owner instead of class; allow any object as owner; local/global variables are owned by their dictionary, only class/instance data is owned by the class; "from...import *" now only imports objects with public access; etc.)
This commit is contained in:
parent
23301a9467
commit
eb6b33a837
9 changed files with 125 additions and 101 deletions
|
|
@ -112,7 +112,7 @@ module_getattr(m, name)
|
|||
err_setstr(AttributeError, name);
|
||||
else {
|
||||
if (is_accessobject(res))
|
||||
res = getaccessvalue(res, getclass());
|
||||
res = getaccessvalue(res, getglobals());
|
||||
else
|
||||
INCREF(res);
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ module_setattr(m, name, v)
|
|||
}
|
||||
ac = dictlookup(m->md_dict, name);
|
||||
if (ac != NULL && is_accessobject(ac))
|
||||
return setaccessvalue(ac, getclass(), v);
|
||||
return setaccessvalue(ac, getglobals(), v);
|
||||
if (v == NULL) {
|
||||
int rv = dictremove(m->md_dict, name);
|
||||
if (rv < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue