#16073: Python 3 preparation: The semantic of map() function is changed
-------------------------------------------------+-------------------------
       Reporter:  wluebbe                        |        Owner:
           Type:  enhancement                    |       Status:
       Priority:  major                          |  needs_work
      Component:  distribution                   |    Milestone:  sage-6.7
       Keywords:  python3                        |   Resolution:
        Authors:  Wilfried Luebbe, André         |    Merged in:
  Apitzsch                                       |    Reviewers:
Report Upstream:  N/A                            |  Work issues:
         Branch:                                 |       Commit:
   Dependencies:  #18472, #18473, #18474,        |     Stopgaps:
  #18531, #18532                                 |
-------------------------------------------------+-------------------------

Comment (by wluebbe):

 There are still a lot of {{{map()}}} call in the code.

 But //not all// occurrences must be  removed: there are a number of places
 where a Py3 {{{map()}}}-iterator leads to the same result as the Py2
 {{{map()}}}.

 Here is a long (but incomplete) list:
 {{{
 all(here_is_an_iterable_allowed)
 any(here_is_an_iterable_allowed)
 bytearray(here_is_an_iterable_allowed)
 dict(here_is_an_iterable_of_key_value_pairs_allowed)
 filter(function, here_is_an_iterable_allowed)
 frozenset(here_is_an_iterable_allowed)
 list(here_is_an_iterable_allowed)
 map(function, here_is_an_iterable_allowed)
 max(here_is_an_iterable_allowed)
 min(here_is_an_iterable_allowed)
 reduce(function, here_is_an_iterable_allowed)
 set(here_is_an_iterable_allowed)
 sorted(here_is_an_iterable_allowed)
 sum(here_is_an_iterable_allowed)
 tuple(here_is_an_iterable_allowed)
 zip(here_is_an_iterable_allowed)

 ''.join(here_is_an_iterable_allowed)
 a,b,c* = here_is_an_iterable_allowed
 x[i:j] = here_is_an_iterable_allowed
 a_dict.update(here_is_an_iterable_of_key_value_pairs_allowed)
 file.writelines(here_is_an_iterable_allowed)
 math.fsum(here_is_an_iterable_allowed)

 and MANY functions in module itertools.

 for i in here_is_an_iterable_allowed:
     pass
 [2*x for x in here_is_an_iterable_allowed]
 (2*x for x in here_is_an_iterable_allowed)
 }}}

 But if the use of {{{map}}} includes a {{{lambda}}} then replacing it with
 a list comprehension improves the readability!

--
Ticket URL: <http://trac.sagemath.org/ticket/16073#comment:54>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to