Skip to content

pathlib.PurePath properties annotated with .. data directive #86610

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

Closed
pganssle opened this issue Nov 23, 2020 · 2 comments
Closed

pathlib.PurePath properties annotated with .. data directive #86610

pganssle opened this issue Nov 23, 2020 · 2 comments
Labels
3.10 only security fixes 3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir topic-pathlib

Comments

@pganssle
Copy link
Member

pganssle commented Nov 23, 2020

BPO 42444
Nosy @ezio-melotti, @merwok, @willingc, @JulienPalard, @pganssle, @ZackerySpytz
PRs
  • bpo-42444: Use attribute directives in the docs for pathlib.PurePath #24977
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-11-23.15:58:31.527>
    labels = ['3.10', 'docs']
    title = 'pathlib.PurePath properties annotated with .. data directive'
    updated_at = <Date 2021-03-22.17:53:20.182>
    user = 'https://github.com/pganssle'

    bugs.python.org fields:

    activity = <Date 2021-03-22.17:53:20.182>
    actor = 'ZackerySpytz'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2020-11-23.15:58:31.527>
    creator = 'p-ganssle'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42444
    keywords = ['patch']
    message_count = 1.0
    messages = ['381673']
    nosy_count = 7.0
    nosy_names = ['ezio.melotti', 'eric.araujo', 'docs@python', 'willingc', 'mdk', 'p-ganssle', 'ZackerySpytz']
    pr_nums = ['24977']
    priority = 'low'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42444'
    versions = ['Python 3.10']

    Linked PRs

    @pganssle
    Copy link
    Member Author

    Currently, it seems that the pathlib module uses `.. data::` to annotate the properties of the PurePath type (e.g. .parts, .drive, .root, etc). See: https://github.com/python/cpython/blob/ff420f0e08a2443339da0df7ace95e14177bac53/Doc/library/pathlib.rst

    According to the documentation (https://devguide.python.org/documenting/#information-units), data is for module-level constants, specifically:

    Describes global data in a module, including both variables and values used
    as “defined constants.” Class and object attributes are not documented using
    this directive.

    I believe that we should switch these over to use the `.. attribute:` directive instead.

    From what I can tell, you can still link to these attributes using the `:attr:` role. I haven't checked if you can link to `:attribute:`s using the `:data:` role, though. If not, it might break some links to change these to `:attribute:`.

    @pganssle pganssle added the 3.10 only security fixes label Nov 23, 2020
    @pganssle pganssle added docs Documentation in the Doc dir 3.10 only security fixes labels Nov 23, 2020
    @pganssle pganssle added the docs Documentation in the Doc dir label Nov 23, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @barneygale barneygale added 3.11 only security fixes 3.12 only security fixes labels Jan 18, 2023
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 20, 2023
    …ythonGH-101114)
    
    (cherry picked from commit 01093b8)
    
    Co-authored-by: Barney Gale <barney.gale@gmail.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 20, 2023
    …ythonGH-101114)
    
    (cherry picked from commit 01093b8)
    
    Co-authored-by: Barney Gale <barney.gale@gmail.com>
    ambv pushed a commit that referenced this issue Jan 20, 2023
    …GH-101114) (#101205)
    
    (cherry picked from commit 01093b8)
    
    Co-authored-by: Barney Gale <barney.gale@gmail.com>
    ambv pushed a commit that referenced this issue Jan 20, 2023
    …GH-101114) (#101206)
    
    (cherry picked from commit 01093b8)
    
    Co-authored-by: Barney Gale <barney.gale@gmail.com>
    @hauntsaninja
    Copy link
    Contributor

    Thanks for fixing!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir topic-pathlib
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants