Skip to content

pathlib.Path.absolute not marked as "new in version 3.11" #99387

Description

@tudortimi

New methods are generally marked as "new in version X". For example, pathlib.Path.is_relative_to is marked as "new in version 3.9" : https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.is_relative_to

image

pathlib.Path.absolute was added in version 3.11, but is not marked as such: https://docs.python.org/3/library/pathlib.html#pathlib.Path.absolute

image

Activity

  1. sobolevn commented on Nov 11, 2022

    @sobolevn
    Member

    @tudortimi this is a good first issue to contribute. Would you like to do it? If you don't have time, no worries - I can help you.

  2. tudortimi commented on Nov 11, 2022

    @tudortimi
    Author

    @sobolevn I'll give it a try.

  3. AA-Turner commented on Nov 12, 2022

    @AA-Turner
    Member

    pathlib.Path.absolute has been in the standard library since pathlib was addded in 3.4, though only documented in GH-26153 -- I am not sure what the precedent is here?

    https://github.com/python/cpython/blame/v3.4.0/Lib/pathlib.py#L1002-L1018

    A

  4. Reddragonemperor58 commented on Nov 12, 2022

    @Reddragonemperor58

    Hi, I am new to open source and this will be my first one so I would like to try it

  5. Reddragonemperor58 commented on Nov 12, 2022

    @Reddragonemperor58

    I have gone through python's helping with documentation, is that enough or is there anything else I need to go through before I start making changes?

  6. brandtbucher commented on Nov 12, 2022

    @brandtbucher
    Member

    I'm not sure that documenting when a function was first documented makes much sense. Saying "New in version ..." is really saying when the feature first became available (and is typically used only if that feature was added after its module or class was first made available). Even the directive itself is called versionadded.

    I recommend we just close this issue.

  7. tudortimi commented on Nov 12, 2022

    @tudortimi
    Author

    @brandtbucher But was the function widely used if it wasn't documented? I for one always used resolve() to get the absolute path, because the table mentioned that it was the equivalent of os.path.abspath():

    image

  8. hauntsaninja commented on Nov 14, 2022

    @hauntsaninja
    Contributor

    Agree with Brandt that closing this issue seems appropriate. Although maybe we could think about backporting #26153 (this would e.g. update the table above in 3.10's docs)?

  9. brettcannon commented on Nov 15, 2022

    @brettcannon
    Member

    Without tests I didn't want to backport the doc changes as I don't know what state the code was i. But I also agree that documenting it as new in 3.11 seems weird, too, since the name has previously existed. I say we just leave the docs alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixesdocsDocumentation in the Doc dirtopic-pathlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions