On 28.06.2017 11:09, Nick Coghlan wrote:
The other thing to look for would be list() and list.extend() calls. I
know I use those quite a bit in combination with str.join, where I
don't actually *need* a list, it's just currently the most convenient
way to accumulate all the components I'm planning to combine. And if
you're converting from Python 2 code, then adding a few list() calls
in critical places in order to keep the obj.extend() calls working is
likely to be easier in many cases than switching over to using
itertools.chain.

This is exactly the reason why I also doubt that Stephan's Sagemath stats are telling anything beyond "chain isn't used that much".

Iterators are only nice to have if you work with simple lists up to 1000 items. Current hardware is able to fix that for you.

There are simply more readable ways of doing "chaining of sequences" for many cases. Even if you are already on Python 3.

In the end, list and "+" operator are the best way of "doing sequences".

Regards,
Sven
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to