bpo-44095: Add suffix, stem and suffixes to zipfile.Path (GH-26129)

This commit is contained in:
Miguel Brito 2021-05-14 18:57:36 +01:00 committed by GitHub
parent 2918846a4f
commit dc0b364de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 93 additions and 0 deletions

View file

@ -2342,6 +2342,18 @@ class Path:
def name(self):
return pathlib.Path(self.at).name or self.filename.name
@property
def suffix(self):
return pathlib.Path(self.at).suffix or self.filename.suffix
@property
def suffixes(self):
return pathlib.Path(self.at).suffixes or self.filename.suffixes
@property
def stem(self):
return pathlib.Path(self.at).stem or self.filename.stem
@property
def filename(self):
return pathlib.Path(self.root.filename).joinpath(self.at)