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 <mertz@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.