Mercurial > cpython-lru_cache-weakref
comparison Python/Python-ast.c @ 36726:bbf16fd024df legacy-trunk
from __future__ import with_statement addon for 'with', mostly written by
Neal.
| author | Thomas Wouters <thomas@python.org> |
|---|---|
| date | Tue, 28 Feb 2006 19:02:24 +0000 |
| parents | 5c36c222e7ca |
| children | dbf9cc6c36eb |
comparison
equal
deleted
inserted
replaced
| 36725:99066bea17f8 | 36726:bbf16fd024df |
|---|---|
| 369 Py_DECREF(fnames); | 369 Py_DECREF(fnames); |
| 370 return NULL; | 370 return NULL; |
| 371 } | 371 } |
| 372 PyTuple_SET_ITEM(fnames, i, field); | 372 PyTuple_SET_ITEM(fnames, i, field); |
| 373 } | 373 } |
| 374 result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}", | 374 result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}", |
| 375 type, base, "_fields", fnames, "__module__", "_ast"); | 375 type, base, "_fields", fnames, "__module__", "_ast"); |
| 376 Py_DECREF(fnames); | 376 Py_DECREF(fnames); |
| 377 return (PyTypeObject*)result; | 377 return (PyTypeObject*)result; |
| 378 } | 378 } |
| 379 | 379 |
| 2954 if (!m) return; | 2954 if (!m) return; |
| 2955 d = PyModule_GetDict(m); | 2955 d = PyModule_GetDict(m); |
| 2956 if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return; | 2956 if (PyDict_SetItemString(d, "AST", (PyObject*)AST_type) < 0) return; |
| 2957 if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0) | 2957 if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0) |
| 2958 return; | 2958 return; |
| 2959 if (PyModule_AddStringConstant(m, "__version__", "42635") < 0) | 2959 if (PyModule_AddStringConstant(m, "__version__", "42649") < 0) |
| 2960 return; | 2960 return; |
| 2961 if(PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return; | 2961 if(PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return; |
| 2962 if(PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) | 2962 if(PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) |
| 2963 return; | 2963 return; |
| 2964 if(PyDict_SetItemString(d, "Interactive", (PyObject*)Interactive_type) | 2964 if(PyDict_SetItemString(d, "Interactive", (PyObject*)Interactive_type) |
