Re: [Python-Dev] Improvements for Pathlib

2014-11-10 Thread Wolfgang Langner
Hi, some background about my pathlib usage. I use the backported version of pathlib and tried to replace the usage of path.py (also widely used library). Some features part of path.py missing in pathlib: - expanduser, expandvars, I have to use the os functions to do this. It is possible but

Re: [Python-Dev] Improvements for Pathlib

2014-11-10 Thread Ionel Cristian Mărieș
On Saturday, November 8, 2014, Xavier Morel python-...@masklinn.net wrote: Why would pathlib need to provide this when tempfile already does? with tempfile.NamedTemporaryFile(prefix='') as f: tmp = pathlib.Path(f.name) with tempfile.TemporaryDirectoryDirectory(prefix='') as d:

Re: [Python-Dev] Improvements for Pathlib

2014-11-10 Thread Ionel Cristian Mărieș
I disagree, having pathlib support in just one place in stdlib is in fact what's really inconsistent. Also, I'm pretty sure that sprinkling pathlib support all over the stdlib isn't going to be pretty. Thanks, -- Ionel M. On Sun, Nov 9, 2014 at 12:06 AM, Xavier Morel python-...@masklinn.net

[Python-Dev] Improvements for Pathlib

2014-11-08 Thread Ionel Cristian Mărieș
Hello, In the current incarnation Pathlib is missing some key features I need in my usecases. I want to contribute them but i'd like a bit of feedback on the new api before jumping to implementation. The four things I need are: #1. A context manager for temporary files and dirs (that cleans

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Ryan Gonzalez
+1 for the context manager ideas. Anything that is like a resource should be available as a context manager. On Sat, Nov 8, 2014 at 9:46 AM, Ionel Cristian Mărieș cont...@ionelmc.ro wrote: Hello, In the current incarnation Pathlib is missing some key features I need in my usecases. I want to

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Xavier Morel
On 2014-11-08, at 16:46 , Ionel Cristian Mărieș cont...@ionelmc.ro wrote: Hello, In the current incarnation Pathlib is missing some key features I need in my usecases. I want to contribute them but i'd like a bit of feedback on the new api before jumping to implementation. The four

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Ethan Furman
On 11/08/2014 10:46 AM, Xavier Morel wrote: On 2014-11-08, at 16:46 , Ionel Cristian Mărieș wrote: In the current incarnation Pathlib is missing some key features I need in my usecases. I want to contribute them but i'd like a bit of feedback on the new api before jumping to implementation.

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Xavier Morel
On 2014-11-08, at 20:02 , Ionel Cristian Mărieș cont...@ionelmc.ro wrote: On Saturday, November 8, 2014, Xavier Morel python-...@masklinn.net wrote: Why would pathlib need to provide this when tempfile already does? with tempfile.NamedTemporaryFile(prefix='') as f: tmp =

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Cameron Simpson
On 08Nov2014 17:46, Ionel Cristian Mărieș cont...@ionelmc.ro wrote: #2. A context manager for changing working directory (that switches to the old cwd on exit). Eg: with path.cd(): assert os.getcwd() == path As elsewhere remarked, the current working directory is process global state.