title: "Unresolved attribute reference" in PyCharm
body: <p>I get an <code>unresolved attribute reference 'get_opposite_node' for class 'list'</code> warning in PyCharm, even though the code works fine.</p>
  
  <p>This the relevant part of the code:</p>
  
  <pre><code>    def bfs(self, start, end):
          visited = {start}  # visited set contains int indices
          start_node = self.Node(start)
          q = deque()
          q.append(start_node)  # deque contains Node objects
          while q:
              cur_node = q.popleft()  # Node object
              if cur_node.idx == end:
                  return cur_node 
  
              for edge in self.get_out_edges(cur_node):
                  # HERE IS WHERE I GET THE WARNING:
                  child = self.Node(edge.get_opposite_node(i))
                  child_idx = child.idx
                  if child_idx not in visited:
                      visited.add(child_idx)
                      q.append(child)
                      child.parent = cur_node
          return None
  
      def get_out_edges(self, node):
          return self.adj[node.idx]
  
      def add_edge(self, line):
          # line is just a string from the input file 
          (v, u, w) = [int(x) for x in line.split()]
          e = Edge(v,u,w)
          self.adj[v].append(e)
          self.adj[u].append(e)
          self.edges.append(e)
  </code></pre>
  
  <p><code>self.adj</code> is the list of lists:<code>self.adj = [[] for _ in range(N)]</code>, which is later filled by the edges of class <code>Edge</code>:</p>
  
  <pre><code>class Edge:
      def __init__(self, v, u, w):
          self.v = v
          self.u = u
          self.w = w
  
      def get_node(self):
          return self.v
  
      def get_opposite_node(self, k=None):
          return self.u if k == self.v or k is None else self.v
  </code></pre>
  
  <p>So, basically, while <code>self.adj[i]</code> contains <code>Edge</code>s, PyCharm thinks that it contains lists(?). Is there a way to 'convince' PyCharm that it is not like this?</p>