Ecogenomics / BamM

Metagenomics-focused BAM file manipulation
http://ecogenomics.github.io/BamM/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Automated changes made using modernize #19

Closed AlexRBaker closed 9 years ago

AlexRBaker commented 9 years ago

The modernize wrapper for 2to3 was used to try and port bamM to python3. Some type issues introduced by the port were fixed but an issue of byte literals versus unicode literals was not resolved.

wwood commented 9 years ago

Hi,

Apologies for letting this sit so long. A question though, perhaps naive. What is the idea behind adding list in the for loops, e.g.

-    for cid in contigs.keys():
+    for cid in list(contigs.keys()):

I don't imagine there is any difference in terms of it working on not, I'm just curious.

AlexRBaker commented 9 years ago

There was a change in dicts.keys(), dict.values() and dict.items() between python 2 and 3. In python 2 these return lists while in python 3 they return dynamic views. Hence, in 2to3.py they erred on the side of caution and change all calls of dicts.keys() etc into lists as they would have been in python 2. I haven't looked through these automatic changes for unnecessary ones so it is still there.