Commits

Michał Górny  committed 7a1fafa

Drop StringCompat2.

  • Participants
  • Parent commits 0976812

Comments (0)

Files changed (1)

File gentoopm/util.py

 	def __repr__(self):
 		return '%s(%s)' % (self.__class__.__name__, repr(str(self)))
 
-class StringCompat2(StringifiedComparisons):
-	"""
-	A helper class providing objects with compatibility string functions,
-	working on stringified form of objects. In other words, it lets you use
-	objects like strings.
-	"""
-
-	def __hasattr__(self, k):
-		return hasattr(str, k)
-
-	def __getattr__(self, k):
-		if not self.__hasattr__(k):
-			raise AttributeError(k)
-		return getattr(str(self), k)
-
-	# other useful special methods
-	def __add__(self, other):
-		return str(self) + other
-
-	def __contains__(self, h):
-		# XXX: might be useful to override this
-		return h in str(self)
-
-	def __format__(self, spec):
-		return format(str(self), spec)
-
-	def __getitem__(self, k):
-		return str(self)[k]
-
-	def __len__(self):
-		return len(str(self))
-
-	def __mul__(self, other):
-		return str(self) * other
-
-	def __rmod__(self, other):
-		return other % str(self)
-
-	def __rmul__(self, other):
-		return other * str(self)
-
-	def __repr__(self):
-		return '%s(%s)' % (self.__class__.__name__, repr(str(self)))
-
 class _SpaceSepIter(object):
 	def __getitem__(self, k):
 		if isinstance(k, str):