def total_seconds(val):
    """
    This is an alternative to the total_seconds method for python2.6.

    :type val: datetime.timedelta
    :param val: Instance of timedelta
    """
    return (
        (val.days * 86400 + val.seconds) * 10**6 + val.microseconds
    ) * 0.1**6