Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It seems to me that it would be straightforward to parse a Template's parameters back into ? placeholders?



No, it would fail upstream before the template post-processing even begin.

The template object itself could not be formed because the each name must be a visible variable name.

This is the same error that you would get with an f-string that contained an undefined variable name.


I'm intrigued but confused by your comment. I think it could be done like this:

    cur.executemany(t"INSERT INTO movie VALUES({data})")
Then the Template object would have a parameter that is a list, and it could turn that into the right number of "?"s to pass into the database driver along with the data.

What am I missing?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: