mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-106752: Sync with zipp 3.16.2 (GH-106757) (#106778)
* gh-106752: Sync with zipp 3.16.2 (#106757) * gh-106752: Sync with zipp 3.16.2 * Add blurb (cherry picked from commit22980dc7c9
) * [3.11] gh-106752: Sync with zipp 3.16.2 (GH-106757) * gh-106752: Sync with zipp 3.16.2 * Add blurb. (cherry picked from commit22980dc7c9
) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * Remove Python 3.12 concerns from changelog.
This commit is contained in:
parent
7dead6a33a
commit
465f5b09df
3 changed files with 19 additions and 4 deletions
|
@ -2420,21 +2420,24 @@ class Path:
|
|||
encoding, args, kwargs = _extract_text_encoding(*args, **kwargs)
|
||||
return io.TextIOWrapper(stream, encoding, *args, **kwargs)
|
||||
|
||||
def _base(self):
|
||||
return pathlib.PurePosixPath(self.at or self.root.filename)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return pathlib.Path(self.at).name or self.filename.name
|
||||
return self._base().name
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
return pathlib.Path(self.at).suffix or self.filename.suffix
|
||||
return self._base().suffix
|
||||
|
||||
@property
|
||||
def suffixes(self):
|
||||
return pathlib.Path(self.at).suffixes or self.filename.suffixes
|
||||
return self._base().suffixes
|
||||
|
||||
@property
|
||||
def stem(self):
|
||||
return pathlib.Path(self.at).stem or self.filename.stem
|
||||
return self._base().stem
|
||||
|
||||
@property
|
||||
def filename(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue