Message307836
Thanks for the fast response and clarification. Now I can run my code made
for py2.7 also run in py3.6
I should search and read documentation before reporting.
Thanks
On Thu, Dec 7, 2017 at 8:03 PM, Steven D'Aprano <report@bugs.python.org>
wrote:
>
> Steven D'Aprano <steve+python@pearwood.info> added the comment:
>
> I decided to run the code in 3.5 and 2.7, and now that I know what I'm
> looking for, I can see the results buried in the Anaconda notebook.
>
> This is not a bug, zip has been changed in Python 3 to return an iterator
> instead of a list. To get the same results as Python 2.7, change the line:
>
> z = zip(j, k)
>
> to:
>
> z = list(zip(j, k))
>
> To get the same results in 2.7 as in 3, change it to:
>
> z = iter(zip(j, k))
>
> This is documented and is not a bug.
>
> https://docs.python.org/3.0/whatsnew/3.0.html#views-and-
> iterators-instead-of-lists
>
> https://docs.python.org/3/library/functions.html#zip
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue32242>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2017-12-08 06:04:49 | Vishu Viswanathan | set | recipients:
+ Vishu Viswanathan |
2017-12-08 06:04:49 | Vishu Viswanathan | link | issue32242 messages |
2017-12-08 06:04:49 | Vishu Viswanathan | create | |
|