内存高效的python对象

atom的Python项目详细描述


https://travis-ci.org/nucleic/atom.svg?branch=masterhttps://codecov.io/gh/nucleic/atom/branch/master/graph/badge.svg

Atom是一个框架,用于创建具有增强的 的动态初始化、验证和更改通知等功能 对象属性。它为 Enaml用户界面框架。

示例:

fromatom.apiimportAtom,Unicode,Range,Bool,observeclassPerson(Atom):""" A simple class representing a person object.

    """last_name=Unicode()first_name=Unicode()age=Range(low=0)debug=Bool(False)@observe('age')defdebug_print(self,change):""" Prints out a debug message whenever the person's age changes.

        """ifself.debug:templ="{first} {last} is {age} years old."s=templ.format(first=self.first_name,last=self.last_name,age=self.age,)print(s)def_default_first_name(self):return'John'john=Person(last_name='Doe',age=42)john.debug=Truejohn.age=43# prints messagejohn.age='forty three'# raises TypeError

有关版本信息,请参见the Revision History

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

推荐PyPI第三方库


热门话题
java如何在JUnit5中定义优先级   Web驱动程序将焦点切换到iframe的java困难   java JFileChooser没有文件名文本字段选项   本地化是否可以回退到Java中resourcebundle的宏语言(例如,nynorsk>norsk)   禁用时Java断言的性能拖动   未考虑执行中的java jsonschema2pojo maven插件配置   java微调器。setSelection未调用setOnItemSelectedListener函数   序列化XStream:序列化java的反序列化。sql。时间导致错误   java无法理解为什么“ajpnio8009execXX”线程在AbstractQueuedSynchronizer$ConditionObject上阻塞/等待时间。等候   Java date给我的格式是mm/dd/yyyy,其中jquery datepicker的日期格式是dd/mm/yyyy   jsf如何用javaweb应用程序在客户端重写csv文件   雅加达ee Java邮件Api,无法从outlook客户端读取“.msg附件”   java PreparedStatement性能调优