def __init__(self, filename: object) -> object:
    try:
        if isinstance(filename, str):
            self.f = open(filename, 'rb')
        else:
            self.f = filename
    except IOError as e:
        sys.stderr.write(('Could not open %s! ' % filename))
        raise e
    self.offset = 0
def __init__(self, filename: object) -> object:
    try:
        if isinstance(filename, str):
            self.f = open(filename, 'rb')
        else:
            self.f = filename
    except IOError as e:
        sys.stderr.write(('Could not open %s! ' % filename))
        raise e
    self.offset = 0