[Python-Dev] TypeError messages

Serhiy Storchaka storchaka at gmail.com
Sat Feb 21 16:35:07 CET 2015


On 21.02.15 16:26, Nick Coghlan wrote:
> Likewise, although as Rob noted, it's sometimes to desirable to use
> the "Z should be X, not Y" form if the shorter form would be
> ambiguous.

Z is not always available.

> Perhaps this should be a recommendation in both PEP 7 & 8? It's
> exactly the kind of issue where having a recommended way to do it can
> save a fair bit of time considering the exact phrasing of error
> messages, as well as improving the developer experience by providing
> more consistent feedback on error details.

It would be great. I'm going to change standard messages in PyArg_Parse* 
and common converting functions (as PyLong_AsLong and 
PyObject_GetBuffer) to make them uniform.




More information about the Python-Dev mailing list