mesonlib: add rsplit and and maxsplit

Since string has a maxsplit as well, we should implement that for
polymorphism
pull/8884/head
Dylan Baker 3 years ago
parent 86da131129
commit f276b2349a
  1. 7
      mesonbuild/mesonlib/universal.py

@ -422,8 +422,11 @@ class File(HoldableObject):
def endswith(self, ending: str) -> bool:
return self.fname.endswith(ending)
def split(self, s: str) -> T.List[str]:
return self.fname.split(s)
def split(self, s: str, maxsplit: int = -1) -> T.List[str]:
return self.fname.split(s, maxsplit=maxsplit)
def rsplit(self, s: str, maxsplit: int = -1) -> T.List[str]:
return self.fname.rsplit(s, maxsplit=maxsplit)
def __eq__(self, other: object) -> bool:
if not isinstance(other, File):

Loading…
Cancel
Save