snap-python icon indicating copy to clipboard operation
snap-python copied to clipboard

Semantics of Nodes() vs GetNodes()

Open rcchen opened this issue 11 years ago • 1 comments

Nodes() currently returns a generator function that iterates across all the nodes in a graph, while GetNodes() returns the number of nodes in the graph. The latter is easily confused with the former, especially when one is just starting out with Snap.py. I would like to propose renaming the latter function to NumNodes().

The same issue exists with Edges() and GetEdges()

rcchen avatar Nov 02 '14 19:11 rcchen

GetNodes() is used in many places, so changing its name is not possible for compatibility reasons.

roks avatar Dec 13 '14 01:12 roks