#16073: Python 3 preparation: The semantic of map() function is changed
-------------------------+-------------------------------------------------
Reporter: | Owner:
wluebbe | Status: needs_review
Type: | Milestone: sage-6.4
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
distribution | Work issues:
Keywords: | Commit:
python3 | f47ac2b0aeef8cd6172206c1f6ef36c326dafdc9
Authors: | Stopgaps:
Wilfried Luebbe |
Report Upstream: N/A |
Branch: |
public/16073 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by wluebbe):
I uploaded a new branch {{{u/wluebbe/ticket/16073-2}}}.
My goal is to replace all {{{map}}} calls with list comprehension or
generator expressions. Currently there are still about 40
{{{list(map(...}}} in the code (somehow my regexp did not find them :-/ )
and a number of {{{map}}}s in the doctests. So there is still some work to
do.
The drawback of wrapping {{{map}}} with {{{list}}} is that in Python2 this
is redundant.
If a context accepts iterators then in Python2 {{{map}}} cannot exploit
this (as it returns a list). Remapping {{{map}}} in Python2 on its
iterator version {{{itertools.imap}}} requires extra code.
The current branch does change list comprehensions to generator
expressions in all possible cases. I would rather leave this refactoring
to a new ticket since there are lots of applicable cases separate from
16073.
I am very much interested in feedback to {{{u/wluebbe/ticket/16073-2}}}.
--
Ticket URL: <http://trac.sagemath.org/ticket/16073#comment:25>
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.