Iterators

Peter Hansen peter at engcorp.com
Tue Jul 13 14:37:50 CEST 2004


Chris Lyon wrote:

> So can anyone point me at some applications, tutorials, websites and
> advantages that these mechanisms provide? that don't rely on having
> done LBIAJ courses such that I dare use them in my own code that
> thrives on the massive over application of lists and dictionaries that
> I believe I finally got my head round.

There is *nothing* wrong with continuing to use (or over-use :-) lists
and dictionaries.  I fully intend to do so myself!

> Apologies to all for continually stirring up the mud at the bottom of
> the crystal clear river that is python but I fear being left behind
> when whatever is built on top of these constructs raises it's head in
> the forseable future.
> 
> As ever I am attempting to use humour (badly) to voice issues that are
> assumed by many but complicated to a few.

I understand where you're coming from, and I'm sure you'll get
some responses from others that will actually point you somewhere
that can help improve your understanding in this area.

I just wanted to reassure you that you don't need to be too
concerned about the whole thing.  I didn't figure out how to
write a list comprehension for at least a year after they were
first added to the language... I had too much productive work
to do with lists.  I have _not_ gone back to change any of the
list-based code(*), and still only rarely reach for list
comprehensions as my first option.

There's nothing wrong with not being a leader in adopting new
language features.  If you try too hard to keep up, you'll
probably "churn" too much and waste time rewriting code or
something, when you could just be writing working code using
the features you know and understand well.

-Peter

* The fact that I no longer work at that the company would, of
course, mean that going back to change the code would result in
criminal trespassing and probably industrial sabotage charges,
but that's beside the point. ;-)



More information about the Python-list mailing list