Re: [Python-ideas] unify usage of mutable and immutable objects

2017-03-31 Thread Neil Girdhar
On Tuesday, February 28, 2017 at 6:48:42 PM UTC-5, 语言破碎处 wrote: > > > A hypothetical frozenset.pop() is also necessarily O(N). It needs to > copy N-1 elements into the new (smaller) frozenset object. So this isn't > an argument. > Pop tuple/frozenset(standard one) gain no benefit. # O(n) > It

Re: [Python-ideas] Construct a matrix from a list: matrix multiplication

2017-03-31 Thread Franklin? Lee
On Fri, Mar 31, 2017 at 3:58 AM, Chris Angelico wrote: > This keeps on coming up in one form or another - either someone > multiplies a list of lists and ends up surprised that they're all the > same, or is frustrated with the verbosity of the alternatives. > > Can we use the

Re: [Python-ideas] Construct a matrix from a list: matrix multiplication

2017-03-31 Thread Chris Angelico
On Sat, Apr 1, 2017 at 12:44 PM, Steven D'Aprano wrote: > On Fri, Mar 31, 2017 at 06:58:21PM +1100, Chris Angelico wrote: >> This keeps on coming up in one form or another - either someone >> multiplies a list of lists and ends up surprised that they're all the >> same, or is

Re: [Python-ideas] Construct a matrix from a list: matrix multiplication

2017-03-31 Thread Steven D'Aprano
On Fri, Mar 31, 2017 at 06:58:21PM +1100, Chris Angelico wrote: > This keeps on coming up in one form or another - either someone > multiplies a list of lists and ends up surprised that they're all the > same, or is frustrated with the verbosity of the alternatives. > > Can we use the matmul

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-03-31 Thread Paul Moore
On 31 March 2017 at 09:20, Stephan Houben wrote: > FWIW, I also strongly prefer the Verbal Expression style and consider > "normal" regular expressions to become quickly unreadable and > unmaintainable. Do you publish your code widely? What's the view of 3rd party users of

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-31 Thread Mark Dickinson
On Thu, Mar 30, 2017 at 10:18 AM, Markus Meskanen wrote: > And wondered, why don't we have a way to repeat other than looping over > range() and using a dummy variable? If it's the assignment to a dummy variable that bothers you, the language already has a way around

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-31 Thread Pavol Lisy
On 3/31/17, Steven D'Aprano wrote: > On Thu, Mar 30, 2017 at 04:23:05PM +0200, Pavol Lisy wrote: >> On 3/30/17, Nick Coghlan wrote: >> > On 30 March 2017 at 19:18, Markus Meskanen >> > wrote: >> >> Hi Pythonistas, >> >> >> >>

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-03-31 Thread Stephan Houben
Hi all, FWIW, I also strongly prefer the Verbal Expression style and consider "normal" regular expressions to become quickly unreadable and unmaintainable. Verbal Expressions are also much more composable. Stephan 2017-03-31 9:23 GMT+02:00 Stephen J. Turnbull

[Python-ideas] Construct a matrix from a list: matrix multiplication

2017-03-31 Thread Chris Angelico
This keeps on coming up in one form or another - either someone multiplies a list of lists and ends up surprised that they're all the same, or is frustrated with the verbosity of the alternatives. Can we use the matmul operator for this? class List(list): def __matmul__(self, other):

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-03-31 Thread Stephen J. Turnbull
Abe Dillon writes: > Note that the entire documentation is 250 words while just the syntax > portion of Python docs for the re module is over 3000 words. Since Verbal Expressions (below, VEs, indicating notation) "compile" to regular expressions (spelling out indicates the internal matching

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-31 Thread Jonathan Goble
On Fri, Mar 31, 2017 at 2:49 AM Suresh V. via Python-ideas < python-ideas@python.org> wrote: > On Thursday 30 March 2017 02:48 PM, Markus Meskanen wrote: > > Hi Pythonistas, > > > > yet again today I ended up writing: > > > > d = [[0] * 5 for _ in range(10)] > > > > And wondered, why don't we

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-31 Thread Suresh V. via Python-ideas
On Thursday 30 March 2017 02:48 PM, Markus Meskanen wrote: Hi Pythonistas, yet again today I ended up writing: d = [[0] * 5 for _ in range(10)] And wondered, why don't we have a way to repeat other than looping over range() and using a dummy variable? This seems like a rather common thing to