[Python-ideas] `to_file()` method for strings

Sven R. Kunze srkunze at mail.de
Fri Mar 25 13:14:57 EDT 2016


On 24.03.2016 22:06, Koos Zevenhoven wrote:
> Or even better, that you could do p"filename.txt", which would give 
> you a Path string object. Has this been discussed?

Interesting. I had this thought half a year ago. Quite recently I 
mentioned this to Andrew in a private conversation.


p'/etc/hosts' would make a perfect path which subclassed from str.


The p-string idea has not been discussed in the PEP I think. The 
subclassing thing however was and I think its resolution was a mistake. 
The explanation, at least from my point of view, is a bit weird.

Maybe, this can be re-discussed in a separate thread? Especially when 
different people think independently of the same issue and the same 
solution.


Best,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160325/3cf41ab0/attachment.html>


More information about the Python-ideas mailing list