sage: class Evens(list): ... def __init__(self, n): ... self.n = n ... list.__init__(self, range(2, n+1, 2)) ... def __repr__(self): ... return "Even positive numbers up to n."
sage: e = Evens(10) sage: e Even positive numbers up to n.
from http://www.sagemath.org/doc/tutorial/tour_help.html,
after entering the class definition, when I type in
e = Evens(10)
I get the error: TypeError: 'sage.rings.integer.Integer' object is not iterable
Why is that? Thanks!