1
在我的代碼中,我使用編譯擴展的對象(在我的例子中爲igraph)。我使用PyLint分析代碼。 PyLint抱怨丟失的屬性(如igraph的Graph.adjacent
),雖然它明顯存在(代碼無誤地運行)。這個消息可能是什麼原因?PyLint錯誤地表示缺少某些屬性的對象
下面是一些測試代碼
import igraph
gr = igraph.Graph(10)#create a graph with 10 vertices
edges = gr.es #no pylint errors
vertices = gr.vs #no pylint errors
print gr.are_connected(0, 1) #pylint error E1101
print gr.adjacent(0) #pylint error E1101
這是pylint的輸出:
************* Module temp
C0111: 1: Missing docstring
C0103: 2: Invalid name "gr" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C0103: 3: Invalid name "edges" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C0103: 4: Invalid name "vertices" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
E1101: 5: Instance of 'Graph' has no 'are_connected' member
E1101: 6: Instance of 'Graph' has no 'adjacent' member
PS:IGRAPH 是在我的PYTHONPATH
請提供一些代碼。 –
@Dhaivat Pandya謝謝,添加示例 –
是您的Python路徑上的igraph? –