Hi
I propose that transaction.on_commit() be modified to take args and kwargs to pass to the callback function. This would mean it effectively constructs a partial() "under the hood":
transaction.on_commit(send_mail, subject=f"...", recipient_list=[user.email], ...)
I think this would be simpler than asking developers to beware of the late-binding problem and use partial(), always or when appropriate.
The only backwards-compatibility concern I can see is the `using` argument, which would not be passed to the underlying function. I don't see this as a huge concern, since it would be the only argument that isn't passed through, and there doesn't seem to be any reason to add further arguments. Users who need to pass a kwarg called 'using' could always construct a partial() themselves.
Thoughts?
Adam