code: def _checkType(self, obj, identifier):
          
          if not isinstance(obj, basestring):
              raise TypeError("expected %s '%s' to be a string (was '%s')" %
                              (identifier, obj, type(obj).__name__))
docs: Assert that an object is of type str.