The following is a real code fragment: ########################################################## class PredicateParser(object, metaclass=ABCMeta): """ Parses a given predicate (which may participate in several relationships) of a given RDF node. """
def __init__(self, predicate): self.predicate = predicate @abstractmethod def parse(self, parse_context, graph, node): pass ########################################################## Now I need to add new field on_error (taking one of three enumerated values) to some objects of this class. What is more pythonic? 1. Create its subclass PredicateParserWithError and add the additional field on_error to this class. 2. Add on_error field to the base class, setting it to None by default, if the class's user does not need this field. -- Victor Porton - http://portonvictor.org -- https://mail.python.org/mailman/listinfo/python-list