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

Side by Side Diff: Python/bltinmodule.c

Issue 19362: Documentation for len() fails to mention that it works on sets
Patch Set: Created 6 years 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:
View unified diff | Download patch
« no previous file with comments | « Doc/library/functions.rst ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Built-in functions */ 1 /* Built-in functions */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "Python-ast.h" 4 #include "Python-ast.h"
5 5
6 #include "node.h" 6 #include "node.h"
7 #include "code.h" 7 #include "code.h"
8 8
9 #include "asdl.h" 9 #include "asdl.h"
10 #include "ast.h" 10 #include "ast.h"
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 1320
1321 res = PyObject_Size(v); 1321 res = PyObject_Size(v);
1322 if (res < 0 && PyErr_Occurred()) 1322 if (res < 0 && PyErr_Occurred())
1323 return NULL; 1323 return NULL;
1324 return PyLong_FromSsize_t(res); 1324 return PyLong_FromSsize_t(res);
1325 } 1325 }
1326 1326
1327 PyDoc_STRVAR(len_doc, 1327 PyDoc_STRVAR(len_doc,
1328 "len(module, object)\n\ 1328 "len(module, object)\n\
1329 \n\ 1329 \n\
1330 Return the number of items of a sequence or mapping."); 1330 Return the number of items of a sequence or collection.");
1331 1331
1332 1332
1333 static PyObject * 1333 static PyObject *
1334 builtin_locals(PyObject *self) 1334 builtin_locals(PyObject *self)
1335 { 1335 {
1336 PyObject *d; 1336 PyObject *d;
1337 1337
1338 d = PyEval_GetLocals(); 1338 d = PyEval_GetLocals();
1339 Py_XINCREF(d); 1339 Py_XINCREF(d);
1340 return d; 1340 return d;
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 if (PyDict_SetItemString(dict, "__debug__", debug) < 0) { 2513 if (PyDict_SetItemString(dict, "__debug__", debug) < 0) {
2514 Py_XDECREF(debug); 2514 Py_XDECREF(debug);
2515 return NULL; 2515 return NULL;
2516 } 2516 }
2517 Py_XDECREF(debug); 2517 Py_XDECREF(debug);
2518 2518
2519 return mod; 2519 return mod;
2520 #undef ADD_TO_ALL 2520 #undef ADD_TO_ALL
2521 #undef SETBUILTIN 2521 #undef SETBUILTIN
2522 } 2522 }
OLDNEW
« no previous file with comments | « Doc/library/functions.rst ('k') | no next file » | no next file with comments »

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