-
-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 preparation: The semantic of filter() function is changed #16067
Comments
Commit: |
comment:2
"Wraps filter() usage in a list call." Often it changes the code as indicated by filter(): "Note that This is more readable and more pythonic as a combination of New commits:
|
Branch: u/wluebbe/ticket/16067 |
comment:3
These are the generated changes. Some manual fixups / improvements to come. |
comment:4
Apparently I did not run Now I will always use |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
In |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Wilfried Luebbe |
comment:8
I think this a complete fix for the This ticket may really belong to stage 1 ... |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Hi André, would you like to review this Py3 ticket? |
comment:11
Hi, Could you check that the indentions are correct, e.g. in
should be
|
Reviewer: André Apitzsch |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Resolved merge conflict, answered the reviewer comment and added a few additional improvements. All doctests pass. |
comment:15
Check your changes in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
Hi André, thank you for reviewing and finding these problems! Apparently I wanted to go too fast :-/ "Eile mit Weile ..." |
Changed branch from u/wluebbe/ticket/16067 to |
In Py2
filter()
returns a list, while in Py3filter()
returns an iterator (asitertools.ifilter()
does in Py2).The tool 2to3 wraps
filter()
usages with a call tolist()
.An alternative approach is to add
from future_builtins import filter
and to check where a wrapping withlist()
is required.There are 53 effected modules.
This ticket is tracked as a dependency of meta-ticket ticket:16052.
CC: @a-andre
Component: distribution
Author: Wilfried Luebbe
Branch/Commit:
49e52c3
Reviewer: André Apitzsch
Issue created by migration from https://trac.sagemath.org/ticket/16067
The text was updated successfully, but these errors were encountered: