Skip to content

Commit 6919c36

Browse files
[3.10] gh-86610: Use attribute directive in docs for pathlib.PurePath (GH-101114) (#101206)
(cherry picked from commit 01093b8) Co-authored-by: Barney Gale <[email protected]>
1 parent f1313ab commit 6919c36

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Doc/library/pathlib.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Accessing individual parts
266266
To access the individual "parts" (components) of a path, use the following
267267
property:
268268

269-
.. data:: PurePath.parts
269+
.. attribute:: PurePath.parts
270270

271271
A tuple giving access to the path's various components::
272272

@@ -290,7 +290,7 @@ Methods and properties
290290

291291
Pure paths provide the following methods and properties:
292292

293-
.. data:: PurePath.drive
293+
.. attribute:: PurePath.drive
294294

295295
A string representing the drive letter or name, if any::
296296

@@ -306,7 +306,7 @@ Pure paths provide the following methods and properties:
306306
>>> PureWindowsPath('//host/share/foo.txt').drive
307307
'\\\\host\\share'
308308

309-
.. data:: PurePath.root
309+
.. attribute:: PurePath.root
310310

311311
A string representing the (local or global) root, if any::
312312

@@ -342,7 +342,7 @@ Pure paths provide the following methods and properties:
342342
an implementation-defined manner, although more than two leading slashes
343343
shall be treated as a single slash."*
344344

345-
.. data:: PurePath.anchor
345+
.. attribute:: PurePath.anchor
346346

347347
The concatenation of the drive and root::
348348

@@ -356,7 +356,7 @@ Pure paths provide the following methods and properties:
356356
'\\\\host\\share\\'
357357

358358

359-
.. data:: PurePath.parents
359+
.. attribute:: PurePath.parents
360360

361361
An immutable sequence providing access to the logical ancestors of
362362
the path::
@@ -372,7 +372,7 @@ Pure paths provide the following methods and properties:
372372
.. versionchanged:: 3.10
373373
The parents sequence now supports :term:`slices <slice>` and negative index values.
374374

375-
.. data:: PurePath.parent
375+
.. attribute:: PurePath.parent
376376

377377
The logical parent of the path::
378378

@@ -401,7 +401,7 @@ Pure paths provide the following methods and properties:
401401
symlinks and eliminate `".."` components.
402402

403403

404-
.. data:: PurePath.name
404+
.. attribute:: PurePath.name
405405

406406
A string representing the final path component, excluding the drive and
407407
root, if any::
@@ -417,7 +417,7 @@ Pure paths provide the following methods and properties:
417417
''
418418

419419

420-
.. data:: PurePath.suffix
420+
.. attribute:: PurePath.suffix
421421

422422
The file extension of the final component, if any::
423423

@@ -429,7 +429,7 @@ Pure paths provide the following methods and properties:
429429
''
430430

431431

432-
.. data:: PurePath.suffixes
432+
.. attribute:: PurePath.suffixes
433433

434434
A list of the path's file extensions::
435435

@@ -441,7 +441,7 @@ Pure paths provide the following methods and properties:
441441
[]
442442

443443

444-
.. data:: PurePath.stem
444+
.. attribute:: PurePath.stem
445445

446446
The final path component, without its suffix::
447447

@@ -1304,11 +1304,11 @@ Below is a table mapping various :mod:`os` functions to their corresponding
13041304
:meth:`Path.group`
13051305
:func:`os.path.isabs` :meth:`PurePath.is_absolute`
13061306
:func:`os.path.join` :func:`PurePath.joinpath`
1307-
:func:`os.path.basename` :data:`PurePath.name`
1308-
:func:`os.path.dirname` :data:`PurePath.parent`
1307+
:func:`os.path.basename` :attr:`PurePath.name`
1308+
:func:`os.path.dirname` :attr:`PurePath.parent`
13091309
:func:`os.path.samefile` :meth:`Path.samefile`
1310-
:func:`os.path.splitext` :data:`PurePath.stem` and
1311-
:data:`PurePath.suffix`
1310+
:func:`os.path.splitext` :attr:`PurePath.stem` and
1311+
:attr:`PurePath.suffix`
13121312
==================================== ==============================
13131313

13141314
.. rubric:: Footnotes

0 commit comments

Comments
 (0)