Writing back to a database

I wouldn't use id. It's already in use by python, as a built-in function: https://cpython-test-docs.readthedocs.io/en/latest/library/functions.html#id
You might not be using this function now, but future you or future co-worker might want to and run into issues.

I work on a project that I didn't initiate, most of it was in place when I came in. There was a script that failed, the trace said that it came from a simple isinstance(something, dict) call. dict had been used as a variable name previously in the script.

3 Likes