docs: def stub(self, obj, attr=None):
          '''
          Stub an object. If attr is not None, will attempt to stub that
          attribute on the object. Only required for modules and other rare
          cases where we can't determine the binding from the object.
          '''
          s = stub(obj, attr)
          if s not in self._stubs:
              self._stubs.append(s)
          return s