[Python-checkins] r61037 - python/trunk/Python/bltinmodule.c

Raymond Hettinger python at rcn.com
Sun Feb 24 03:28:51 CET 2008


These messages should include transition recommendations where possible:

   map(None,...) is not supported in 3.x.  Use zip() instead.
   sorted(seq, cmp, ...) is not supported in 3.x.  Use key= instead.

----- Original Message ----- 
From: "neal.norwitz" <python-checkins at python.org>
To: <python-checkins at python.org>
Sent: Saturday, February 23, 2008 6:20 PM
Subject: [Python-checkins] r61037 - python/trunk/Python/bltinmodule.c


> Author: neal.norwitz
> Date: Sun Feb 24 03:20:25 2008
> New Revision: 61037
> 
> Modified:
>   python/trunk/Python/bltinmodule.c
> Log:
> map(None, ...) is not supported in 3.0.
> 
> 
> Modified: python/trunk/Python/bltinmodule.c
> ==============================================================================
> --- python/trunk/Python/bltinmodule.c (original)
> +++ python/trunk/Python/bltinmodule.c Sun Feb 24 03:20:25 2008
> @@ -909,9 +909,15 @@
>  func = PyTuple_GetItem(args, 0);
>  n--;
> 
> - if (func == Py_None && n == 1) {
> - /* map(None, S) is the same as list(S). */
> - return PySequence_List(PyTuple_GetItem(args, 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
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins


More information about the Python-checkins mailing list