python类工具
classical的Python项目详细描述
使用python类的便利工具。
简化子类化:
classMyClass:def__init__(self,*args,**kwargs):pass# do whatever# subclass with presetsMySubClass=argumented_subclass(MyClass,'MySubClass',arg1='value',arg2=4)
各种描述符:
classThing:Red=ArgumentedSubclass(color='red')book=AutoProperty(has='pages')def__init__(self,color=None,has=None):self.color=colorself.has=hasThing.Red# is a subclass of Thing and is 'red'Thing.Red.book# is an instance of Thing (and Thing.Red), is 'red' and has 'pages'
请参见http://classical.readthedocs.io/en/latest/
安装
pip install classical
测试
make test
可能需要安装[develop]extras才能运行测试
生成文档
make docs
您可能需要安装[develop]extras来生成文档