Python3 函数注释的类型提示与 Boo
我已经开始使用 python 进行一个中型项目,我决定使用 python 3,因为我没有使用任何大型外部库,并且 py3k 有一些不错的新语法糖,更重要的是函数注释。然而,似乎 WingIDE、Pydev 或 pycharm 实际上都不支持使用函数注释的类型提示。如果我想要类似 python 中的静态类型的东西,切换到 boo 是一个合理的选择吗?
I've started on a medium-sized project in python, and I decided to use python 3 because I'm not using any large external libraries and py3k has some nice new syntactic sugar and more importantly function annotations. However, it seems like none of WingIDE, Pydev, or pycharm actually have any support for type hinting using function annotations. If I want something resembling static typing in python, is switching to boo a reasonable option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Boo 是一种伟大类似 Python 的静态类型语言,但请记住,比静态类型更多的差异。实际上,您也可以在 Boo 上进行鸭式打字。
从技术上讲,我想说最大的区别是 Boo 在 Mono/.Net 上运行,因此库和框架完全不同。
SharpDevelop 和 MonoDevelop 都对 Boo 提供了良好的支持。还有一个添加了 Boo 支持的 Visual Studio 2010 插件< /a>.它仍然是 alpha,但已经可以使用了。
Boo is a great Python-like statically-typed language, but keep in mind that there more differences than just static typing. Actually you can also do duck typing on Boo.
Technically, I'd say the biggest difference is that Boo runs on Mono/.Net so the libraries and framework are totally different.
SharpDevelop and MonoDevelop both have good support for Boo. There's also a Visual Studio 2010 plugin that adds Boo support. It's still alpha, yet already usable.
您可以尝试使用 Cython。在某种程度上,它是具有静态类型的 CPython。
另请参阅此链接
You could try with Cython. It is in some way CPython with static typing.
See also this link