[Python-ideas] Move Demo scripts under Lib

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Oct 26 16:00:33 CEST 2010


I originally proposed this under the Demo and Tools cleanup issue [1].
  The idea was to create a new package "demo" in the standard library
which will host selected demo programs or modules that currently
reside in the Demo/ directory of the source distribution.  There are
several advantages to this approach:

1. Discoverability.  Currently, various distributions place demo
scripts in different places or not include them at all.   There is no
easy way for an end user to discover them.  With a demo package, there
will be a natural place in the python manual to document demo scripts
and users will be able to run them using -m option.  IDEs will be able
to present demo source code and documentation consistently.

2. Test coverage.  One of the points raised in [1] was that Demo
scripts are not routinely tested.  While it is not strictly necessary
to move them under Lib to enable testing, doing so will put these
scripts on the same footing as the rest of the standard library
modules eliminating an unnecessary barrier to writing tests.

3. Quality/relevance.  Many scripts in Demo are very old and do not
reflect modern best practices.  By picking and choosing what goes to
Lib/demo, we can improve the demo collection without removing older
scripts that some may find useful.

One objection raised to this idea was that Demo scripts do not have
the same stability of the API and backward compatibility requirements
as the rest of the standard library.   I don't think this is a serious
issue.  As long as we don't start importing demo modules from other
stdlib modules, there is no impact on the stdlib itself from changing
demo APIs.  Users may be warned that their production programs should
not depend on the demo modules.  I think the word "demo" itself
suggests that.

What do you think?


[1] http://bugs.python.org/issue7962#msg111677



More information about the Python-ideas mailing list