biopython/biopython — pull request #30 by slowkow (2012-03-20 03:33:40+00:00)
Title: Not all calls to `.keys()` should be deleted.

Commit bdf94b3b70 deleted a lot of calls to `.keys()`. Some of those calls should not be deleted. I spotted one of them.

Removing the call to `keys()` on line 999 caused `prev_partitions` to be a shallow copy of `self.charpartitions` instead of a previous copy of the keys. In the next line, `self.charpartitions` is modified and therefore so is `prev_partitions`. So, the requirement in the list comprehension `n not in prev_partitions` is impossible to meet and the `NexusError` will always be raised. I encountered the raised error when trying to read a nexus file.