1. Michał Górny
  2. gentoopm

Commits

Michał Górny  committed 3777bae

Fix SpaceSepFrozenSet[].

  • Participants
  • Parent commits aba8a87
  • Branches master

Comments (0)

Files changed (1)

File gentoopm/util.py

View file
  • Ignore whitespace
 class _SpaceSepIter(object):
 	def __getitem__(self, k):
 		if isinstance(k, str):
-			return self[self.index(k)]
+			for i in self:
+				if i == k:
+					return i
+			else:
+				raise KeyError('No item matches %s' % repr(k))
 		return tuple.__getitem__(self, k)
 
 	def __str__(self):