Skip to content
Snippets Groups Projects
  • marco's avatar
    7a3dcf3d
    fix iterator for sequence handle · 7a3dcf3d
    marco authored
    This bug actually lead to the discovery of an interesting
    phenotype of the "for" statement. If a class has the
    __getitem__() defined and doesn't have a __iter__(),
    Python uses __getitem__() to iterate over the items,
    stopping when a IndexError is thrown. Previously we were
    throwing a normal RuntimeError which Python didn't recognize
    as the end of the list.
    
    git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2467 5a81b35b-ba03-0410-adc8-b2c5c5119f08
    7a3dcf3d
    History
    fix iterator for sequence handle
    marco authored
    This bug actually lead to the discovery of an interesting
    phenotype of the "for" statement. If a class has the
    __getitem__() defined and doesn't have a __iter__(),
    Python uses __getitem__() to iterate over the items,
    stopping when a IndexError is thrown. Previously we were
    throwing a normal RuntimeError which Python didn't recognize
    as the end of the list.
    
    git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2467 5a81b35b-ba03-0410-adc8-b2c5c5119f08