I have myself been "guilty" of using the problem style for N < 10. In fact, I had forgotten about the optimization even, since my uses are negligible time.
For stuff like this, it's fast no matter what: for clause in query_clauses: sql += clause Maybe I have a WHERE or two. Maybe an ORDER BY. Etc. But if I'm sure there won't be more than 6 such clauses to the query I'm building, so what? Or probably likewise with bits of a file path, or a URL with optional parameters, and a few other things. On Mon, Mar 30, 2020 at 11:15 PM David Mertz <me...@gnosis.cx> wrote: > Does anyone know if any linters find and warn about the `string += word` > in a loop pattern? It feels like a linter would be the place to do that. I > don't think we could possibly make it an actual interpreter warning given > borderline OK uses (or possibly even preferred ones). But a little nagging > in tooling could draw attention. > > > > -- > Keeping medicines from the bloodstreams of the sick; food > from the bellies of the hungry; books from the hands of the > uneducated; technology from the underdeveloped; and putting > advocates of freedom in prisons. Intellectual property is > to the 21st century what the slave trade was to the 16th. > -- Keeping medicines from the bloodstreams of the sick; food from the bellies of the hungry; books from the hands of the uneducated; technology from the underdeveloped; and putting advocates of freedom in prisons. Intellectual property is to the 21st century what the slave trade was to the 16th.
_______________________________________________ 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/JBHFZIONF2U3MJKICM6AEJFEPZ4UGRUM/ Code of Conduct: http://python.org/psf/codeofconduct/