Examples are a good idea, especially when your class has a complex
API. But examples are only a part of a documentation. Don't create
examples instead of a documentation. You should store the
documentation and the examples in a sub directory 'docs' of the
package directory.
有个例子当然不错,尤其当你的类有一个复合API.但例子只是文档的一部分.不要创建一个例子去替代文档.你把文档或者例子存储到包目录下一个"docs"的子目录.
Test scripts are recommended when your class has to be compiled,
requires special extentions/programs or needs correctly installed
additional files (i.e. templates, graphics). Store them in sub
directory called 'tests'.
你的类被编译前,测试下是个好的习惯.一个特殊的扩展名/程序或者需要一个恰当的附加文件安装(等等..模板.图片).存储他们到一个"tests"的目录下.