class Bold: def __init__(self, text): self.text = text def toHTML(self): return '<b>%s</b>' % slides.toHTML(self.text) Bullet(Bold("some text")) # a bullet whose text is bold