
Ezio Melotti added the comment:
Documentation examples are meant to be read, not executed
I agree, but several of them already run, and others run with the addition of doctests directives (that are hidden in the html output). If the code needs to be changed in a way that is less readable, the test can just be skipped.
Furthermore, spreading unit tests in the doc files instead of Lib/test files will make maintenance of tests more tedious as well.
Tests should be kept in Lib/test, this is mostly to make sure that the examples are correct. The examples in the docs should still be written with the goal to be clear for the user -- being valid doctests is a secondary goal. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15629> _______________________________________