votes up 2

None cannot be a node

Package:
Exception Class:
ValueError

Raise code

""" 

        On many platforms hashable items also include mutables such as
        NetworkX Graphs, though one should be careful that the hash
        doesn't change on mutables.
        """
        if node_for_adding not in self._succ:
            if node_for_adding is None:
                raise ValueError("None cannot be a node")
            self._succ[node_for_adding] = self.adjlist_inner_dict_factory()
            self._pred[node_for_adding] = self.adjlist_inner_dict_factory()
            attr_dict = self._node[node_for_adding] = self.node_attr_dict_factory()
            attr_dict.update(attr)
        else:  # update attr even if node already exists
            self._node[node_for_adding].update(attr)
😲  Walkingbet is Android app that pays you real bitcoins for a walking. Withdrawable real money bonus is available now, hurry up! 🚶

Ways to fix

votes up 1 votes down
if node_for_adding not in self._succ:
 if node_for_adding is None:
 raise ValueError("None cannot be a node")
 self._succ[node_for_adding] = self.adjlist_inner_dict_factory()
 self._pred[node_for_adding] = self.adjlist_inner_dict_factory()
 attr_dict = self._node[node_for_adding] = self.node_attr_dict_factory()
 attr_dict.update(attr)
else: # update attr even if node already exists
 self._node[node_for_adding].update(attr)

Nov 27, 2022 wang1tian answer
wang1tian 502

Add a possible fix

Please authorize to post fix