PyDev 7.3.0毫无用地警告有关Python 3.7的可迭代解压缩 [英] PyDev 7.3.0 warns uselessly about iterable unpacking with Python 3.7

查看:26
本文介绍了PyDev 7.3.0毫无用地警告有关Python 3.7的可迭代解压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

停止编辑只是为了获得很少的声望而无济于事,谢谢

首先,它不会打扰我的代码的编译.命令(base)user @ machine:〜$ python script.py 可以完美地工作并提供我期望的结果.
麻烦的是在Eclipse中的代码版本期间.虽然以下行是可接受的,并且可以使用Python 3.7很好地编译: a,b,c = * func_returns_2_things(),func_returns_1_thing().
Eclipse警告:遇到"*"在X行的Y列.期望使用以下之一:(" ...,"{" ...#依此类推
当然,我尝试了这个 [* func_returns_2_things(),func_returns_1_thing()] ,但它仍然警告错误: Expected:] .说警告"因为警告中提到的是一个黄色三角形,在这里,这显然是一个带有红色叉号的红色圆圈(如果您知道我的意思).

在Eclipse版本中,我该怎么做才能停止这种无用的警告?

注意: def func_returns_2_things():返回1,2 def func_returns_1_thing():返回4


版本
面向Java开发人员的Eclipse IDE
版本:2019-03(4.11.0)
版本号:20190314-1200

PyDev for Eclipse
版本:7.3.0.201908161924
内部版本ID:org.python.pydev.feature.feature.group
提供者:法比奥·扎德罗兹尼(Fabio Zadrozny)

Pydev Mylyn集成
版本:0.6.0
内部版本ID:org.python.pydev.mylyn.feature.feature.group
提供者:法比奥·扎德罗兹尼(Fabio Zadrozny)

解决方案

我认为问题可能在于您的项目已配置为验证不同版本的Python的语法.

ie:在项目属性PyDev-Interpreter/Grammar中,您可能选择了旧版本的Python(在 Grammar版本其他语法验证中)./p>

请参阅: https://www.pydev.org/manual_101_project_conf2.html 了解更多详细信息.

Stop editing just to gain few points of reputations and not helping, thanks

First of all, it does not bother the compilation of my code. The command (base) user@machine:~$ python script.py works perfectly and gives what I expect.
What is bothering is during the edition of the code in Eclipse. While the following line is acceptable and compiled well with Python 3.7 a,b,c = *func_returns_2_things(),func_returns_1_thing().
What Eclipse warns : Encountered "*" at line X, column Y. Was expecting one of: "("..., "{"... #and so on
Of course, I tried this [*func_returns_2_things(),func_returns_1_thing()] but it still warns an error: Expected:].
Besides I shouldn't not say "warns" because warning are mentioned with a yellow triangle, and here this is clearly a red circle with red cross in (if you know what I mean).

What can I do to stop this useless warning in my Eclipse edition ?

Notes: def func_returns_2_things(): return 1,2 ; def func_returns_1_thing(): return 4


Versions
Eclipse IDE for Java Developers
Version: 2019-03 (4.11.0)
Build id: 20190314-1200

PyDev for Eclipse
Version: 7.3.0.201908161924
Build id:org.python.pydev.feature.feature.group
Provider: Fabio Zadrozny

Pydev Mylyn Integration
Version: 0.6.0
Build id:org.python.pydev.mylyn.feature.feature.group
Provider: Fabio Zadrozny

解决方案

I think that the problem is probably that your project is configured to validate the syntax for a different version of Python.

i.e.: In the project properties, PyDev - Interpreter/Grammar you probably have an older version of Python selected (either in Grammar version or Additional syntax validation).

See: https://www.pydev.org/manual_101_project_conf2.html for more details.

这篇关于PyDev 7.3.0毫无用地警告有关Python 3.7的可迭代解压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆