'Constructor: Rat([num[, den]]).
The arguments must be ints or longs, and default to (0, 1).'

def __init__(self, num=0L, den=1L):

    if (not isint(num)):
        raise TypeError, ('Rat    numerator    must    be    int    or    long    (%r)' % num)
    if (not isint(den)):
        raise TypeError, ('Rat    denominator    must    be    int    or    long    (%r)' % den)
    if (den == 0):
        raise ZeroDivisionError, 'zero    denominator'
    g = gcd(den, num)
    self.__num = long((num // g))
    self.__den = long((den // g))
