The .degree() method returns incorrect (or at least very unusual) results for undirected graphs with self-loops.
Example:
g3 = rx.PyGraph()
g3.extend_from_edge_list([(0,1), (0,0)])
g3.degree(0)
The correct result is 3. Note that the degree is not the same as the number of incident edges. It is the number of edge endpoints.
Certainly, one may reinterpret the meaning of "degree", but diverging from the de-facto standard textbook definition is not a good idea. It is going to be extremely confusing for users.