> import sys > > class C_hash(int if sys.version_info.major >= 3 else long): ...
There's nothing incorrect with your solution. Chris offered another. I was going to suggest you consider running your code through 2to3 to see what it does. I created a C_hash class similar to yours: class C_hash(long): def __new__(cls, bits, m, N=1): obj = super(C_hash, cls).__new__(cls, bits) obj._m = m obj._N = N return obj def meth(self): pass When I ran it through 2to3, it didn't make any transformations, which I thought odd. Still, assuming I did something wrong, you might poke around with it a bit to see if you can get it to do the work for you. Skip -- https://mail.python.org/mailman/listinfo/python-list