def is_comment(self): ''' Check if this element is a comment ''' return isinstance(self.context, Comment)