[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-16 Thread Random832
On Sat, Nov 16, 2019, at 16:13, Greg Ewing wrote: > On 17/11/19 4:54 am, Ricky Teachey wrote: > > > I think it'd be at least as confusing as the current situation. > > It might be better to keep it as purely a context manager, and > not load it down with any other baggage. > > I wouldn't

[Python-ideas] Re: Please consider adding of functions file system operations to pathlib

2019-11-16 Thread George Fischhof
Steve Jorgensen ezt írta (időpont: 2019. nov. 14., Cs, 10:59): > Michel Desmoulin wrote: > > +1 > > We already merged, os.path and glob with pathlib. Let's do all os and > > shutil. > > It's weird enough for beginners to even sumble upon that many ways of > > doing thing for FS. > > Le 20/02/2018

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-16 Thread Greg Ewing
On 17/11/19 10:34 am, Andrew Barnert wrote: On Nov 16, 2019, at 13:13, Greg Ewing wrote: It might be better to keep it as purely a context manager, and not load it down with any other baggage. Doesn’t `closing` already take care of that (and other things besides files, too)? No, because a

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-16 Thread Andrew Barnert via Python-ideas
On Nov 16, 2019, at 13:13, Greg Ewing wrote: > > It might be better to keep it as purely a context manager, and > not load it down with any other baggage. Doesn’t `closing` already take care of that (and other things besides files, too)? I’m not really sure what problem we’re trying to solve h

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-16 Thread Greg Ewing
On 17/11/19 4:54 am, Ricky Teachey wrote: I think it'd be at least as confusing as the current situation. It might be better to keep it as purely a context manager, and not load it down with any other baggage. I wouldn't try to make it remember the current directory. Like a generator expr

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-16 Thread Ricky Teachey
> > >> > > >> Maybe some of these things could be simpler if it was clarified that a > > >> context manager shouldn't acquire resource before __enter__ and a new > > >> version of open was provided. > > >> > > > > > > Hmm. What exactly is the object that you have prior to the file being > > > opene