Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

In general, Python functions don't document all possible exceptions.  One 
reason is that it would lead to substantial redundancy in the docs.  Another 
reason is that functions generally don't know all the possible exceptions that 
can be raised because that can be controlled determined by the data itself.  
Also, the docs try to focus on core functionality and not drown out the message 
with side details.

For comparison, look at str.startswith() or math.cos() which can raise a 
TypeError if the input type is incorrect.  There is no reason to discuss that 
in the docs because most functions raise a TypeError when the type is 
incorrect.  This is more of a general FAQ than a function by function 
documentation issue.

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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

Reply via email to