Andrew Koenig <ark-mlist at 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 at cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4