On Thu, Oct 24, 2019 at 4:22 AM Andrew Barnert via Python-ideas
<python-ideas@python.org> wrote:
>
> On Oct 23, 2019, at 10:04, Christopher Barker <python...@gmail.com> wrote:
> >
> > This talk about optimization is confusing me:
>
> The main argument for why “a b c”.split() is not good enough, and therefore 
> we need a new syntax, is that it’s “too slow”.
>
> Someone earlier in this thread said we could optimize calling split on a 
> string literal, just as we can and do optimize iterating over a list literal 
> in a for statement.

I was the one to post it in this thread, but it wasn't my invention -
talk of optimizing method calls on literals has been around before.

> I agree. That’s why I think “too slow” isn’t a good argument, and to the tiny 
> extent that it is, “then let’s write an optimizer for the already-common 
> idiom” is a good answer, not “let’s come up with a whole new syntax that does 
> the same thing”.
>

Agreed. The value of creating new syntax is (must be) that it better
expresses programmer intent, not that it's easier to optimize.

ChrisA
_______________________________________________
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/HMP2G65MSY3UK6REF7INPBNWSFPEHUFX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to