This is incorrect. RemoveVertex() takes one argument "torrent_id". You may want to use collections.deque to automatically limit the size of self.vertices.