This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add 'str' property to PathLib
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Arka, matrixise, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-02-09 10:44 by Arka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5595 Arka, 2018-02-09 11:11
Messages (8)
msg311872 - (view) Author: Arka (Arka) * Date: 2018-02-09 10:46
Add 'str' property to PurePath in PathLib that calls __str__ function and returns the string representation of the path. It is easier to use than str(Path). Many existing methods accept only strings as a path.
msg311873 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-02-09 10:48
I have seen your PR, why did you close it?
msg311874 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-02-09 10:49
and currently for the feature, the PR should be based on master and not 3.5 or 3.6. because these branch are only for the security and bugfix modes.

Read the devguide at this url: https://devguide.python.org/#status-of-python-branches
msg311876 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-09 10:59
Are you aware of PEP 519?
msg311877 - (view) Author: Arka (Arka) * Date: 2018-02-09 11:18
@matrixise

Because the bots were saying, 'skip news', 'skip issue' labels are not found.
msg311884 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2018-02-09 14:05
This would not be a pythonic API.
msg311885 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2018-02-09 14:13
That was kind of an abrupt message, let me be more verbose: thank you for wanting to improve python, but as Serhiy pointed out we already solved the problem you are considering via PEP 519.  In addition to that we consider str(x) to be the right way to get the string representation of something.  Adding an attribute containing the string value is not how python operates in general, so we wouldn't make an exception for this class (and note that this possibility was discussed in the lead up to PEP 519 and rejected).
msg311936 - (view) Author: Arka (Arka) * Date: 2018-02-10 04:35
@Serhiy

No, I wasn't aware of that.

@R. David Murray

Thank you, David. What you said, makes sense and I agree with you.
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76988
2018-02-10 04:35:46Arkasetmessages: + msg311936
2018-02-09 14:13:34r.david.murraysetmessages: + msg311885
2018-02-09 14:05:21r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg311884

resolution: rejected
stage: patch review -> resolved
2018-02-09 11:18:23Arkasetmessages: + msg311877
2018-02-09 11:11:49Arkasetkeywords: + patch
stage: patch review
pull_requests: + pull_request5411
2018-02-09 10:59:44serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg311876
2018-02-09 10:49:51matrixisesetmessages: + msg311874
versions: + Python 3.8, - Python 3.6
2018-02-09 10:48:17matrixisesetnosy: + matrixise
messages: + msg311873
2018-02-09 10:46:26Arkasetversions: + Python 3.6
messages: + msg311872
components: + Library (Lib)
title: Add -> Add 'str' property to PathLib
2018-02-09 10:44:05Arkacreate