You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Method Path.absolute is missing from docs <v3.11 (I checked all of them: 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10).
It only appears in docs for v3.11+[3], although it is part of the class Path since pathlib was added in v3.4[1,2].
It would be useful to have, as one needs to see the distinction between Path.absolute and Path.resolve (which is included in the docs since v3.4) in regards to normalization or resolving symlinks for example (see docstrings or docs for v3.11[3]).
Docstrings taken from pathlib.py of v3.9.17:
(I appreciate the explicit mentioning of the treatment of '.' and '..' with Path.absolute in this version!)
def absolute(self):
"""Return an absolute version of this path. This function works
even if the path doesn't point to anything.
No normalization is done, i.e. all '.' and '..' will be kept along.
Use resolve() to get the canonical path to a file.
"""
def resolve(self, strict=False):
"""
Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows).
"""
(these functions also appear next to each other in the code[4])
It would be nice, if the topics of "path normalization" and "symlink resolving" would be described more clearly in the context of those functions. The handling of '..' is mentioned in the context of Path.resolve and also PurePaths (in constructor and PurePath.parent).
Yet, the trap with Path.absolute is only mentioned by the documenation for Path.resolve stating: “..” components are also eliminated (this is the only method to do so):
e-d-n-a
changed the title
pathlib docs: Method Path.absolute is missing from docs <v3.11 (also destinction from Path.resolve and rel. topics)
pathlib docs: Method Path.absolute is missing from docs <v3.11 (also distinction from Path.resolve and rel. topics)
Jul 13, 2024
Hello! Thanks for the report.
Unfortunately, we cannot fix that due to CPython policy: versions older than 3.12 accept only security fixes. This one is not about security :(
Documentation
Method
Path.absolute
is missing from docs <v3.11 (I checked all of them: 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10).It only appears in docs for v3.11+[3], although it is part of the class Path since
pathlib
was added in v3.4[1,2].It would be useful to have, as one needs to see the distinction between
Path.absolute
andPath.resolve
(which is included in the docs since v3.4) in regards to normalization or resolving symlinks for example (see docstrings or docs for v3.11[3]).Docstrings taken from
pathlib.py
of v3.9.17:(I appreciate the explicit mentioning of the treatment of '.' and '..' with Path.absolute in this version!)
(these functions also appear next to each other in the code[4])
It would be nice, if the topics of "path normalization" and "symlink resolving" would be described more clearly in the context of those functions. The handling of '..' is mentioned in the context of
Path.resolve
and alsoPurePaths
(in constructor andPurePath.parent
).Yet, the trap with
Path.absolute
is only mentioned by the documenation forPath.resolve
stating:“..” components are also eliminated (this is the only method to do so):
Refs:
The text was updated successfully, but these errors were encountered: