Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13)

Delta Between Two Patch Sets: Objects/typeobject.c

Issue 20204: pydocs fails for some C implemented classes
Left Patch Set: Created 6 years ago
Right Patch Set: Created 4 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* Type object implementation */ 1 /* Type object implementation */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "frameobject.h" 4 #include "frameobject.h"
5 #include "structmember.h" 5 #include "structmember.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 9
10 /* Support type attribute cache */ 10 /* Support type attribute cache */
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 if (type->tp_dictoffset) { 2683 if (type->tp_dictoffset) {
2684 res->ht_cached_keys = _PyDict_NewKeysForClass(); 2684 res->ht_cached_keys = _PyDict_NewKeysForClass();
2685 } 2685 }
2686 2686
2687 /* Set type.__module__ */ 2687 /* Set type.__module__ */
2688 s = strrchr(spec->name, '.'); 2688 s = strrchr(spec->name, '.');
2689 if (s != NULL) 2689 if (s != NULL)
2690 _PyDict_SetItemId(type->tp_dict, &PyId___module__, 2690 _PyDict_SetItemId(type->tp_dict, &PyId___module__,
2691 PyUnicode_FromStringAndSize( 2691 PyUnicode_FromStringAndSize(
2692 spec->name, (Py_ssize_t)(s - spec->name))); 2692 spec->name, (Py_ssize_t)(s - spec->name)));
2693 else {
2694 if (PyErr_WarnFormat(PyExc_SyntaxWarning, 1,
2695 "builtin type %.200s has no the __module__ attribute",
2696 spec->name)) {
2697 Py_DECREF(res);
2698 return NULL;
2699 }
2700 }
2693 2701
2694 return (PyObject*)res; 2702 return (PyObject*)res;
2695 2703
2696 fail: 2704 fail:
2697 Py_DECREF(res); 2705 Py_DECREF(res);
2698 return NULL; 2706 return NULL;
2699 } 2707 }
2700 2708
2701 PyObject * 2709 PyObject *
2702 PyType_FromSpec(PyType_Spec *spec) 2710 PyType_FromSpec(PyType_Spec *spec)
(...skipping 4423 matching lines...) Expand 10 before | Expand all | Expand 10 after
7126 0, /* tp_base */ 7134 0, /* tp_base */
7127 0, /* tp_dict */ 7135 0, /* tp_dict */
7128 super_descr_get, /* tp_descr_get */ 7136 super_descr_get, /* tp_descr_get */
7129 0, /* tp_descr_set */ 7137 0, /* tp_descr_set */
7130 0, /* tp_dictoffset */ 7138 0, /* tp_dictoffset */
7131 super_init, /* tp_init */ 7139 super_init, /* tp_init */
7132 PyType_GenericAlloc, /* tp_alloc */ 7140 PyType_GenericAlloc, /* tp_alloc */
7133 PyType_GenericNew, /* tp_new */ 7141 PyType_GenericNew, /* tp_new */
7134 PyObject_GC_Del, /* tp_free */ 7142 PyObject_GC_Del, /* tp_free */
7135 }; 7143 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+