Python pearls required for iteration across fields of data structure
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Tue Jul 24 12:14:57 CEST 2007
On Tue, 24 Jul 2007 02:26:15 -0700, NetHead wrote:
> The code below is WRONG, but hopefully illustrates what I am trying to
> Any suggestions how to code this is an efficient and maintainable (and
> correct) manner?
> for i in wildcards:
> for j in i:
> j = self.replaceFieldsAndIndices(j, rcn, rcu,
> rcp, indices)
> # Ignore errors if condition has no format.
Maybe you shouldn't silence all exceptions with a bare except here. This
swallows any errors in `replaceFieldsAndIndices()`. Maybe some of them
are not the exception you expect, but real errors in your program!?
Marc 'BlackJack' Rintscj
More information about the Python-list