mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
map(None, ...) is not supported in 3.0.
This commit is contained in:
parent
8c460d5241
commit
53152a1905
1 changed files with 9 additions and 3 deletions
|
@ -909,10 +909,16 @@ builtin_map(PyObject *self, PyObject *args)
|
|||
func = PyTuple_GetItem(args, 0);
|
||||
n--;
|
||||
|
||||
if (func == Py_None && n == 1) {
|
||||
if (func == Py_None) {
|
||||
if (Py_Py3kWarningFlag &&
|
||||
PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"map(None, ...) not supported in 3.x") < 0)
|
||||
return NULL;
|
||||
if (n == 1) {
|
||||
/* map(None, S) is the same as list(S). */
|
||||
return PySequence_List(PyTuple_GetItem(args, 1));
|
||||
}
|
||||
}
|
||||
|
||||
/* Get space for sequence descriptors. Must NULL out the iterator
|
||||
* pointers so that jumping to Fail_2 later doesn't see trash.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue