I think it is because the base template class has this variable; oh, or doesn't it? –– that *is* true, it does not. Ideally, ``_digest`` would call some "public" method then (e.g. ``signature``) and that method would then contribute whatever strings were part of the template signature. If a subclass had ``trim_attribute_space`` then that class should override ``signature`` and provide it. That would be a cleaner approach I think than just duck-typing it: ``getattr(self, "trim_attribute_space", "")``. I don't like using ``self.__dict__`` unless you really mean that it shouldn't be an attribute. But that seems a little artificial here. It might be a property:

    @property
    def trim_attribute_space(self):
        ...