类似 PEP 354 的枚举实现

发布于 2024-12-06 15:38:00 字数 144 浏览 6 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

世界和平 2024-12-13 15:38:00

http://pypi.python.org/pypi/enum/ 是此 PEP 的实现。

http://pypi.python.org/pypi/enum/ is the implementation of this PEP.

小帐篷 2024-12-13 15:38:00

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文