Help understanding the decisions *behind* python?
sturlamolden at yahoo.no
Sun Aug 2 05:10:00 CEST 2009
On 2 Aug, 04:47, Nobody <nob... at nowhere.com> wrote:
> OTOH, using a "for" loop when you could use a generator means less work
> when you need to make a minor change and a generator is no longer
It's not just that. It is e.g. using a for loop and indexes instead of
a slice. E.g.
for i in range(10): # Java idiom
a[i] = b[i+1]
a[:10] = b[1:11] # Pythonic
More information about the Python-list