Commits

Michał Górny committed f6fc5c0

SpaceSepTuple: support getting items by text.

Comments (0)

Files changed (1)

 			s = s.split()
 		return tuple.__new__(self, s)
 
+	def __getitem__(self, k):
+		if isinstance(k, str):
+			return self[self.index(k)]
+		return tuple.__getitem__(self, k)
+
 	def __str__(self):
 		return ' '.join(self)