Re: [Python-ideas] fnmatch.filter_false

2017-05-21 Thread Pavol Lisy
On 5/21/17, Steven D'Aprano wrote: > On Sun, May 21, 2017 at 08:04:04AM +0200, Pavol Lisy wrote: > >> If fnmatch.filter was written to solve performance, isn't calling >> _filtered step back? > > It adds overhead of *one* function call regardless of how many > thousands or millions of names you ar

[Python-ideas] Suggestion: push() method for lists

2017-05-21 Thread Paul Laos
It would be nice to have the opposite of the pop() method: a push() method. While insert() and append() already exist, neither is the opposite of pop(). pop() has a default index parameter -1, but neither insert() nor append() has a default index parameter. push(obj) would be equivalent to inser

Re: [Python-ideas] Suggestion: push() method for lists

2017-05-21 Thread Juancarlo AƱez
On Sun, May 21, 2017 at 10:43 AM, Paul Laos wrote: > By default push(obj) would insert an object to the end of the list, while > push(obj, index) would insert the object at index, just like pop() removes > (and returns) the object at the end of the list, and pop(index) removes > (and returns) the

Re: [Python-ideas] Suggestion: push() method for lists

2017-05-21 Thread Todd
On Sun, May 21, 2017 at 10:43 AM, Paul Laos wrote: > It would be nice to have the opposite of the pop() method: a push() > method. While insert() and append() already exist, neither is the opposite > of pop(). pop() has a default index parameter -1, but neither insert() nor > append() has a defau

Re: [Python-ideas] Suggestion: push() method for lists

2017-05-21 Thread Nick Coghlan
On 22 May 2017 at 00:43, Paul Laos wrote: > So while it has been discussed before, it's worth bringing up again, since > this was before the release of Python 2.0. It was also before the addition of collections.deque. which uses appendleft() and extendleft(), rather than pushleft(). > Pros: > >