简体   繁体   English

是否有任何Python IDE支持类型提示或函数参数的有限代码完成功能?

[英]Do any Python IDEs have support for type hinting or limited code completion for function arguments?

I like using IDEs when writing stuff in Python or other languages because modern features like call tips or code completion make things much easier. 我喜欢用Python或其他语言编写东西时使用IDE,因为调用提示或代码完成等现代功能使事情变得更加轻松。 Since Python is a dynamically typed language there is, of course, no way to provide these features for variables such as function arguments. 由于Python是一种动态类型化的语言,因此当然无法为变量(例如函数参数)提供这些功能。 This causes the modern features to disappear, which results in everything being cumbersome and time consuming, because I usually have to reference class definitions to double check the correctness of what I'm accessing. 这将导致现代功能消失,从而导致一切繁琐且耗时,因为我通常必须引用类定义来仔细检查所访问内容的正确性。

Are there any Python IDEs that have support for code completion by suggesting an expected type for a variable? 是否有任何Python IDE通过建议变量的预期类型来支持代码完成? For example, if variable x is expected to be a str class, I would like to be able to suggest that x 's type is str and have code completion enabled for that class. 例如,如果变量x预期为str类,我希望能够建议x的类型为str并为该类启用代码完成功能。

I read that PyDev might be able to do this, but I really don't want to use it because Eclipse. 我读到PyDev也许可以做到这一点,但是我真的不想使用它,因为Eclipse。 My preferred IDE is PyScripter, but I'm fairly certain that it can't do this. 我首选的IDE是PyScripter,但我可以肯定它不能做到这一点。

尝试使用PyCharm,支持代码完成,动态错误突出显示,自动修复等。http://www.jetbrains.com/pycharm/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM