
Andrew Koenig <ark-mlist@att.net>:
(It has been pointed out that subclassing int isn't very useful, so maybe this is a moot point. Does anybody have a real use case?)
isinstance(x, int)
That doesn't require an inheritance relationship between the integral types, but it does require that long inherit from int.
Having int be an abstract class doesn't prevent it from being subclassed - it just means the subclass needs to to more work in order to behave like other concrete int subclasses. Along with short and long, there could be a UserInt subclass which delegates all the operations to an implementation object, for people who really want an int subclass for some reason. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+