[Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Dec 3 21:54:21 EST 2003

Mike Thompson <mike.thompson at day8.com.au>:

> Of course, this obvious solution has a problem:  a programmer can't easily
> sub-class Int.

I can't see that subclassing int is a particularly useful thing to do,
even as matters stand today. As soon as you do any operation on your
int subclass, you get a result which is not an instance of your
subclass any more, which makes using it rather fragile.

Does anyone have a real-life use case for subclassing int?

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	   +--------------------------------------+

More information about the Python-Dev mailing list