mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Support for tp_getattro, tp_setattro (Sjoerd)
This commit is contained in:
parent
929f1b83ea
commit
d8eb1b340f
3 changed files with 33 additions and 0 deletions
|
@ -769,6 +769,9 @@ getattro(v, name)
|
|||
object *v;
|
||||
object *name;
|
||||
{
|
||||
if (v->ob_type->tp_getattro != NULL)
|
||||
return (*v->ob_type->tp_getattro)(v, name);
|
||||
|
||||
if (name != last_name_object) {
|
||||
XDECREF(last_name_object);
|
||||
INCREF(name);
|
||||
|
@ -784,6 +787,9 @@ setattro(v, name, value)
|
|||
object *name;
|
||||
object *value;
|
||||
{
|
||||
if (v->ob_type->tp_setattro != NULL)
|
||||
return (*v->ob_type->tp_setattro)(v, name, value);
|
||||
|
||||
if (name != last_name_object) {
|
||||
XDECREF(last_name_object);
|
||||
INCREF(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue