对python 3的trait支持

py3traits的Python项目详细描述


Documentation StatusTravis-CI Build StatusPyPI Package monthly downloadsPyPI Wheelpyversions

对python 3的trait支持

  • 免费软件:apache许可证

安装

pip install py3traits

开发

要运行所有测试,请运行:

tox

关于特质

traits是包含可用于扩展的方法的类 其他类,与子类相似,但特性不使用 继承权。相反,特质被组合成其他类别。也就是说; 方法、属性和内部状态被复制到主对象。

重点是通过将代码分成简单的 然后可以组合成实际类的构造块。

从维基百科上阅读更多信息:http://en.wikipedia.org/wiki/Traits_class

从examples文件夹中查找示例。

更改日志

1.2.0(2015-07-08)

  • New feature: Precompiled functions can be used with properties
  • New feature: @validation decorator for validating arguments by value
  • New feature: Factory class for object creation
  • Improving feature: @type_safe and @type_converted wraps functions properly
  • Fixed homepage link which was pointing to Python 2 version
  • Added back the missing github link in documentation
  • Done a major overhaul for the core to better support adding new features
  • Many other bigger or smaller improvements

1.1.0(2015-06-13)

  • Improving feature: setproperty does not require all property functions
  • Improving feature: added name as more convenient way to name the property
  • Improving example: examples/property_is_created_into_instance.py
  • Changing version numbering.

1.0.1(2015-06-12)

  • New feature: Added setproperty convenience function
  • New example: examples/property_is_created_into_instance.py
  • Added documentation
  • Some refactoring for testability
  • Added new test utility to parametrize tests
  • Added unit tests

1.0.0(2015-05-25)

  • First official release

0.15.0(2015-05-23)

  • New feature: Alternative syntax added to add_traits function
  • New example: examples/composition_in_alternative_syntax.py
  • New example: examples/multiple_traits_composed_into_new_class.py
  • Addes unit tests

0.14.0(2015-05-19)

  • New feature: Setter and Deleter for properties are now supported
  • New example: examples/instance_is_composed_from_cherrypicked_property_in_class.py
  • New example: examples/instance_is_composed_from_cherrypicked_property_in_instance.py
  • Updated example: examples/class_is_composed_from_cherrypicked_property_in_class.py
  • Updated example: examples/class_is_composed_from_cherrypicked_property_in_instance.py

0.13.0(2015-04-25)

  • New feature: Decorator type_safe to check function arguments
  • New feature: combine_class function takes name for new class as first argument
  • Refactoring magic.py to look less like black magic
  • Improving errors.py exception class creation to accept custom messages
  • Adding unit tests

0.12.0(2015-04-22)

  • New feature: Rename of composed traits
  • Cleaning up parts belonging to py2traits

0.11.0(2015-04-18)

  • PEP8 fixes
  • General cleaning for all files
  • Removed unused parts
  • Removed Python 2 code

0.10.0(2015-03-30)

  • Splitting into two projects: py2traits and py3traits
  • Taking new project template to use from cookiecutter.

0.9.0恢复了python 2.x的兼容性

  • Some small clean up too

0.8.0添加对私有类和实例属性的支持

  • Redone function binding to include recompilation of the function
  • Leaving Python 2.x into unsupported state temporarily.

0.7.0提高库的可用性

  • Introduced new extendable decorator, which adds function to add traits to object
  • Introduced new function combine_class to create new classes out of traits
  • Fixed module imports through out the library
  • Improved documentation in examples

0.6.0重组成库

  • Added support for py.test
  • Preparing to support tox
  • Improved multiple examples and renamed them to make more sense
  • Removed the need of having two separate code branches for different Python versions

0.5.0实例现在可以用python 3.x中的traits进行扩展

  • Instance support now similar to classes
  • Added more examples

0.4.0用python 2.x中的示例完成了函数绑定

  • Separate functions can now be bound to classes - Functions with ‘self’ as a first parameter will be acting as a method - Functions with ‘cls’ as a first parameter will be acting as classmethod - Other functions will be static methods.
  • Fixed an issue with binding functions

0.3.0对python 2.x

的无冲突特性扩展支持
  • Classes can be extended
  • Instances can be extended
  • Python 2.x supported

0.2.0 apache许可证更新

  • Added apache 2.0 license to all files
  • Set the character set as utf-8 for all files

0.1.0初始版本

  • prepared files for Python 2.x
  • prepared files for Python 3.x

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java RandomAccessFile:在循环中写入(字节)或写入(字节数组),哪个更有效?   从命令行运行maven+eclipse的java   在java中无法用正则表达式替换字符串   java Eclipse输出字符与键盘键值不同   JavaWeb服务(服务器客户端)。服务器使用外部项目   java试图制作“夜间模式”过滤器   java Box2d加速和限制车轮速度   javascript JQuery DataTable页面长度在第1页之后不受尊重   java如何使用DefaultCellEditor使JT的列只能得到数字,并在点后用两个符号进行四舍五入?   无法在Java中实例化泛型类型实例   java My code在我的代码中出现数组越界异常,但在前两次输入出错后,它将运行并崩溃   字符串的Java代码压缩和解压缩   SpringBootJava。lang.IllegalStateException:无法解析公共组织中的参数[0]。springframework。http。响应<java。lang.Object>   java在安卓中访问容器的子级   为什么Java不能从InputStream正确地重新创建此映像?