Re: [Python-ideas] Add a .chunks() method to sequences

2017-05-05 Thread Nick Coghlan
On 5 May 2017 at 08:20, Greg Ewing wrote: > Victor Stinner wrote: >> >> I prefer str.join() approach: write a single chunks() function which >> takes a sequence, instead of modifying all sequence types around the >> world ;-) > > > Even if a general sequence-chunking function is thought useful, >

[Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread George Fischhof
Hi Folks, I have a task to synchronize folders but some files should be remained untouched. I think this is a very common task. I found that shutil.copytree() has ignore_patterns() but rmtree() has not. So here comes my idea: add ignore_patterns() to rmtree() it is a good feature and makes the f

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread Serhiy Storchaka
On 05.05.17 10:58, George Fischhof wrote: I have a task to synchronize folders but some files should be remained untouched. I think this is a very common task. I found that shutil.copytree() has ignore_patterns() but rmtree() has not. So here comes my idea: add ignore_patterns() to rmtree() it

Re: [Python-ideas] Add a .chunks() method to sequences

2017-05-05 Thread Erik
Hi Nick, On 05/05/17 08:29, Nick Coghlan wrote: And then given the proposed str.splitgroups() on the one hand, and the existing memoryview.cast() on the other, offering itertools.itergroups() as a corresponding building block specifically for working with streams of regular data would make sense

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread George Fischhof
2017-05-05 11:52 GMT+02:00 Serhiy Storchaka : > On 05.05.17 10:58, George Fischhof wrote: > >> I have a task to synchronize folders but some files should be remained >> untouched. >> I think this is a very common task. >> >> I found that shutil.copytree() has ignore_patterns() but rmtree() has not

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread Oleg Broytman
Hi! On Fri, May 05, 2017 at 09:58:15AM +0200, George Fischhof wrote: > Hi Folks, > > I have a task to synchronize folders but some files should be remained > untouched. Synchronize folders using rmtree()? I don't get it. > I think this is a very common task. I think it is not that comm

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread George Fischhof
2017-05-05 13:02 GMT+02:00 Oleg Broytman : > Hi! > > On Fri, May 05, 2017 at 09:58:15AM +0200, George Fischhof < > [email protected]> wrote: > > Hi Folks, > > > > I have a task to synchronize folders but some files should be remained > > untouched. > >Synchronize folders using rmtree()? I don

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread Oleg Broytman
On Fri, May 05, 2017 at 03:55:37PM +0200, George Fischhof wrote: > Actually it would be good if copytree() would be able to overwrite files > and directories. Seems you want rsync, no? > George Oleg. -- Oleg Broytmanhttp://phdru.name/[email protected]

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread George Fischhof
yes, something like that ... ;-) but I use windows, and I want the feature in Python, with a simple and elegant way (1-2 commands) 2017-05-05 16:14 GMT+02:00 Oleg Broytman : > On Fri, May 05, 2017 at 03:55:37PM +0200, George Fischhof < > [email protected]> wrote: > > Actually it would be good if

Re: [Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

2017-05-05 Thread Oleg Broytman
On Fri, May 05, 2017 at 04:50:07PM +0200, George Fischhof wrote: > yes, something like that ... ;-) but I use windows, and I want the feature > in Python, with a simple and elegant way (1-2 commands) > > 2017-05-05 16:14 GMT+02:00 Oleg Broytman : > > > On Fri, May 05, 2017 at 03:55:37PM +0200,