MonkeeSage wrote: > With list.has_index() / get(), the following (pretty common I think) > idiom: > > try: > data = some_unknown_seq[2] > except IndexError: > data = None > if data: ...
umm. you could at least write: try: data = some_unknown_seq[2] except IndexError: pass else: ... deal with data ... but "let's hypergeneralize and treat sequences and mappings as the same thing" proposals are nothing new; a trip to the archives might be help- ful. </F> -- http://mail.python.org/mailman/listinfo/python-list