class ReadHTML(object):

    def __init__(self, url=None, page=None):
        if url is not None:
            page = urlopen(url).read()
self.page = page

@classmethod
def from_file(cls, path):
    page = open(path).read()
return cls(page=page)
Создание метода класса Python