类似 PEP 354 的枚举实现
Python 开发人员曾一度考虑将枚举添加到该语言中,但他们放弃了该功能。是否有 PEP 354 的实现? ——该规范看起来相当稳健。
At one point enums were considered by the Python developers to add to the language, but they dropped the feature. Is there some implementation of the PEP 354? — the specification seems pretty robust.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://pypi.python.org/pypi/enum/ 是此 PEP 的实现。
http://pypi.python.org/pypi/enum/ is the implementation of this PEP.
PyPI 包 enum 提供了数据类型的 Python 实现本 PEP 中描述。
另外,还有 Barry Warsaw 的实现。
最后,PEP 435 已被 Python 3.4 接受,向后移植为 enum34,高级版本为aenum。
The PyPI package enum provides a Python implementation of the data types described in this PEP.
Also, an implementation by Barry Warsaw.
Finally, PEP 435 has been accepted for Python 3.4, the backport is enum34, and the advanced version is aenum.