Hello Tutors, I'm stumped. This silly bit of code doesn't work. I expect the output to be 8, not 18. What am I missing?
#!/usr/bin/env python '''An Under10 class, just to fiddle with inheriting from int.''' class Under10(int): def __init__(self, number): number %= 10 int.__init__(self, number) if __name__ == '__main__': n = Under10(18) print n ''' $ ./new_style.py 18 ''' Any ideas? Thank you. Marilyn Davis _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor