![](/img/trans.png)
[英]Highlighting maya commands (such as polySphere) in Eclipse (with PyDev) and EclipseMayaEditor
[英]Eclipse with PyDev error highlighting
帶有PyDev的Eclipse在某些奇怪的地方突出顯示了錯誤。 它檢測到類似這樣的函數的錯誤(這是“ A Byte of Python”中有關VarArgs
函數的VarArgs
):
def total(initial=5, *numbers, extra_number=10):
count = initial
for number in numbers:
count += number
count += extra_number
print(count)
在第一行檢測到的錯誤是: Expected:)
和undefined variable: extra_number
。 我認為它不理解帶有關鍵字的參數。
另外,當我嘗試將變量與nonlocal
詞一起使用時,出現錯誤: undefined variable: nonlocal
。
如何改善PyDev的錯誤消息並關閉這些示例的錯誤?
PyCharm
或Komodo
上的PS我看不到那些錯誤,但是我非常喜歡開源PyDev
。
好吧,這告訴我您實際上是在使用Python 2.x
而不是3.x
因為您指定的兩個錯誤都將出現在2.x
而不是3.x
。
在PyDev中檢查交戰者,您可能已將其設置為2.7
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.