answered 11 years ago
To access the source code you can do
sage: my_object??
In your case
sage: R = WeylCharacterRing(['A',2], prefix="R") sage: x = R.an_element() sage: x.invariant_degree??