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? –