【发布时间】:2011-02-11 21:12:10
【问题描述】:
经过大量 PHP 经验后,我正在学习 Python,在 Python 中使用 type-hinting 会很方便。看起来带有 PyDev 的 Eclipse 不支持这个。有什么建议?
例如,我希望我的 IDE 在使用时显示函数 docstrings 和 types,例如:
def f(x: int) -> int:
r"""Adds 3 to x"""
return x + 3
f(# and now IDE shows everything about types
【问题讨论】:
-
你试过科莫多吗?不完全确定它处理文档字符串,但它确实有智能感知。
-
谁能确认 Komodo 是否满足最初的问题?
-
我测试了 vscode、Sublime Text、Wing IDE 和 Pycharm。只有 Pycharm 会报告
foo: str = 1(Expected type 'str' got 'int' instead)。 Pycharms 重构也是最好的,虽然并不完美。
标签: python pydev type-hinting