Ethan Furman <et...@stoneleaf.us> added the comment:

The idea behind PEP 519 was to alleviate str(path_obj) calls between the 
os/program interface.  We can either make that as consistent as we can as we 
find places that still require the str(path_obj) idiom, or we can make users 
remember which ones do, and which ones don't, easily use a Path object.

In my opinion, having to remember is a very unpleasant and frustrating user 
experience.

Serhiy Storchaka:
----------------
> Path-like objects are now unintentionally accepted for many non-path
> things, like hostname in socket.sethostname() and username in
> os.initgroups(). I also think it was a mistake, and we should not
> make new mistakes.

There will always be ways for users to make mistakes when using API's.  Whether 
they passed a Path path to os.sethostname() or a string path to 
os.sethostbyname(), it's still their bug, and linters/type-checkers exist to 
help catch those kinds of bugs.

Brett Canon:
-----------
> Environment variables are strings, period, so they should be specified
> as such;

Out of curiosity, any idea how often non-strings are used to set os.environ, 
and so need explicit conversion?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to