On Wed, Oct 23, 2019 at 11:59:44AM -0400, Todd wrote:

> Compare that to:
> 
> colors2 = "cyan,forest green,burnt umber".split(',')

Sure, that's not going away. But consider that you're using this inside 
a tight loop:

    for something in lots_of_items:
        for another in more_items:
            function(spam, eggs, "cyan,forest green,burnt umber".split(','))


That's easy to fix, you say. Move the list outside the loop:

    L = "cyan,forest green,burnt umber".split(','))
    for something in lots_of_items:
        for another in more_items:
            function(spam, eggs, L)

What's wrong with this picture?



-- 
Steven
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/HKWL77SF2ZDK4RWX4N6FB7CA7QZF5ZV5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to