mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)
Automerge-Triggered-By: GH:jaraco
This commit is contained in:
parent
b230409f21
commit
928dbfc16c
4 changed files with 24 additions and 3 deletions
|
|
@ -483,7 +483,7 @@ Path Objects
|
|||
Path objects expose the following features of :mod:`pathlib.Path`
|
||||
objects:
|
||||
|
||||
Path objects are traversable using the ``/`` operator.
|
||||
Path objects are traversable using the ``/`` operator or ``joinpath``.
|
||||
|
||||
.. attribute:: Path.name
|
||||
|
||||
|
|
@ -532,6 +532,19 @@ Path objects are traversable using the ``/`` operator.
|
|||
|
||||
Read the current file as bytes.
|
||||
|
||||
.. method:: Path.joinpath(*other)
|
||||
|
||||
Return a new Path object with each of the *other* arguments
|
||||
joined. The following are equivalent::
|
||||
|
||||
>>> Path(...).joinpath('child').joinpath('grandchild')
|
||||
>>> Path(...).joinpath('child', 'grandchild')
|
||||
>>> Path(...) / 'child' / 'grandchild'
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Prior to 3.10, ``joinpath`` was undocumented and accepted
|
||||
exactly one parameter.
|
||||
|
||||
|
||||
.. _pyzipfile-objects:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue