diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-03-13 07:14:25 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-03-13 07:14:25 (GMT) |
commit | 7554f0dd3ca6219db07adcc222cef776d37512a6 (patch) | |
tree | 9139b775096275084284e8b2cf459c81818ffc58 /Python/Python-ast.c | |
parent | 9186850088a94627b60fa80102edc858c332b51c (diff) | |
parent | a9719057a2ee1875c6334b1d5fbbf66cfc02ca78 (diff) | |
download | cpython-7554f0dd3ca6219db07adcc222cef776d37512a6.zip cpython-7554f0dd3ca6219db07adcc222cef776d37512a6.tar.gz cpython-7554f0dd3ca6219db07adcc222cef776d37512a6.tar.bz2 |
merge heads
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r-- | Python/Python-ast.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 2603b81..1178d74 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1,5 +1,7 @@ /* File automatically generated by Parser/asdl_c.py. */ +#include <stddef.h> + #include "Python.h" #include "Python-ast.h" @@ -453,6 +455,11 @@ static char *withitem_fields[]={ }; +typedef struct { + PyObject_HEAD + PyObject *dict; +} AST_object; + static int ast_type_init(PyObject *self, PyObject *args, PyObject *kw) { @@ -531,10 +538,15 @@ static PyMethodDef ast_type_methods[] = { {NULL} }; +static PyGetSetDef ast_type_getsets[] = { + {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict}, + {NULL} +}; + static PyTypeObject AST_type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "_ast.AST", - sizeof(PyObject), + sizeof(AST_object), 0, 0, /* tp_dealloc */ 0, /* tp_print */ @@ -561,12 +573,12 @@ static PyTypeObject AST_type = { 0, /* tp_iternext */ ast_type_methods, /* tp_methods */ 0, /* tp_members */ - 0, /* tp_getset */ + ast_type_getsets, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ + offsetof(AST_object, dict),/* tp_dictoffset */ (initproc)ast_type_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ PyType_GenericNew, /* tp_new */ |