On Fri, 14 Sep 2007 18:19:45 -0700, James Stroud wrote: >> How do I subclass int and/or long so that my class also auto-converts >> only when needed? >> >> >> >> > Use __new__.
The disadvantage of that is that your example code requires me to duplicate my methods in the long version and the int version. It's easy enough to work around that (class factory function) but it just seems all rather untidy... -- Steven. -- http://mail.python.org/mailman/listinfo/python-list