Skip to content

gh-86610: Use attribute directive in docs for pathlib.PurePath #101114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Accessing individual parts
To access the individual "parts" (components) of a path, use the following
property:

.. data:: PurePath.parts
.. attribute:: PurePath.parts

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

Expand All @@ -290,7 +290,7 @@ Methods and properties

Pure paths provide the following methods and properties:

.. data:: PurePath.drive
.. attribute:: PurePath.drive

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

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

.. data:: PurePath.root
.. attribute:: PurePath.root

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

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

.. data:: PurePath.anchor
.. attribute:: PurePath.anchor

The concatenation of the drive and root::

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


.. data:: PurePath.parents
.. attribute:: PurePath.parents

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

.. data:: PurePath.parent
.. attribute:: PurePath.parent

The logical parent of the path::

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


.. data:: PurePath.name
.. attribute:: PurePath.name

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


.. data:: PurePath.suffix
.. attribute:: PurePath.suffix

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

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


.. data:: PurePath.suffixes
.. attribute:: PurePath.suffixes

A list of the path's file extensions::

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


.. data:: PurePath.stem
.. attribute:: PurePath.stem

The final path component, without its suffix::

Expand Down Expand Up @@ -1445,11 +1445,11 @@ Below is a table mapping various :mod:`os` functions to their corresponding
:meth:`Path.group`
:func:`os.path.isabs` :meth:`PurePath.is_absolute`
:func:`os.path.join` :func:`PurePath.joinpath`
:func:`os.path.basename` :data:`PurePath.name`
:func:`os.path.dirname` :data:`PurePath.parent`
:func:`os.path.basename` :attr:`PurePath.name`
:func:`os.path.dirname` :attr:`PurePath.parent`
:func:`os.path.samefile` :meth:`Path.samefile`
:func:`os.path.splitext` :data:`PurePath.stem` and
:data:`PurePath.suffix`
:func:`os.path.splitext` :attr:`PurePath.stem` and
:attr:`PurePath.suffix`
==================================== ==============================

.. rubric:: Footnotes
Expand Down