A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-April/143781.html below:

[Python-Dev] summary: a Path protocol

[Python-Dev] summary: a Path protocol [Python-Dev] summary: a Path protocolChris Angelico rosuav at gmail.com
Fri Apr 8 02:57:55 EDT 2016
On Fri, Apr 8, 2016 at 4:35 PM, Victor Stinner <victor.stinner at gmail.com> wrote:
> Sorry, I don't have time to read the whole discussion. What is the problem
> with adding a __str__ to pathlib?
>
> Victor

Everything else has __str__ too, so you run the risk of open(["Hello",
"World"], "w") working and doing something weird. Or of passing an
open file object to something that was expecting a file name, and
having *that* work too. Calling str(p) on something that ought to be
either a Path or a string should raise an exception if given something
else.

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4