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/143661.html below:

[Python-Dev] When should pathlib stop being provisional?

[Python-Dev] When should pathlib stop being provisional? [Python-Dev] When should pathlib stop being provisional?Guido van Rossum guido at python.org
Wed Apr 6 01:00:01 EDT 2016
On Tue, Apr 5, 2016 at 9:29 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> [...] we can't do:
>
>     app_root = Path(...)
>     config = app_root/'settings.cfg'
>     with open(config) as blah:
>         # whatever
>
> It feels like instead of addressing this basic disconnect, the answer has
> instead been:  add that to pathlib!  Which works great -- until a user or a
> library gets this path object and tries to use something from os on it.

I agree that asking for config.open() isn't the right answer here
(even if it happens to work). But in this example, once 3.5.2 is out,
the solution would be to use open(config.path), and that will also
work when passing it to a library. Is it still unacceptable then?

-- 
--Guido van Rossum (python.org/~guido)
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