class ReadHTML(object):

    def __init__(self, page):
        self.page = page

@classmethod
def from_filename(cls, path):
    with open(path) as f:
        page = f.read()
return cls(page)

@classmethod
def from_url(cls, url):
    page = urlopen(url).read()
return cls(page)
Creating a Python classmethod