Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I agree that the error message should contain the name of the absent parameter 
instead of its index when parameters are supplied as a dict. It is more 
informative and would consistent with other error message.

As for including the number of a record in the error message, I am not sure we 
should do this.

1. For other errors (too large integer, string containing surrogate characters, 
error in custom adapter, etc) the error message does not contain neither 
parameter name nor index. If we want to attach references to parameter and 
record, it is much more larger problem. It may require designing a general 
method for attaching additional information to exceptions and writing a PEP. It 
is a LARGE problem.

2. ProgrammingError is a programming error. In correctly working program you 
should never see such kind of errors, because you are responsible for preparing 
the statement and providing the consistent number of parameter values.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41638>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to