Re: Multiple equates

2008-12-04 Thread Jeremiah Dodds
On Thu, Dec 4, 2008 at 1:19 PM, Hendrik van Rooyen [EMAIL PROTECTED]wrote: Cameron Laird [EMAIL PROTECTED] wrote: There's a realm within Pythonia that favors lambdalessness. And who, may I ask, Is the King of this realm? - Hendrik --

Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Steven D'Aprano
Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. -- http://mail.python.org/mailman/listinfo/python-list

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Andreas Waldenburger
On 04 Dec 2008 15:53:21 GMT Steven D'Aprano [EMAIL PROTECTED] wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. So? Maybe he is. What's your problem? /W -- My real email address is constructed by swapping the domain with the recipient (local part).

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Hendrik van Rooyen
Steven D'Aprano stev..urce.com.au wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. I always knew I was more advanced than other people... :-) Well spotted! Thanks - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Hendrik van Rooyen
Andreas Waldenburger [EMAIL PROTECTED] On 04 Dec 2008 15:53:21 GMT Steven D'Aprano [EMAIL PROTECTED] wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. So? Maybe he is. What's your problem? It was probably playing hob with his threading

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Tim Chase
Steven D'Aprano wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. further evidence of the Guido's time-machine[1]. For the secret cabal of core developers who borrow the time-machine, I recommend not sending email from within it. :) -tkc [1]

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Andreas Waldenburger
On Thu, 4 Dec 2008 06:40:02 +0200 Hendrik van Rooyen [EMAIL PROTECTED] wrote: Andreas Waldenburger [EMAIL PROTECTED] On 04 Dec 2008 15:53:21 GMT Steven D'Aprano [EMAIL PROTECTED] wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. So?

Re: Multiple equates

2008-12-03 Thread Lawrence D'Oliveiro
Cameron Laird wrote: def f1(Match): return Something missing here? -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Cameron Laird wrote: def f1(Match): return Something missing here? Ugh; yes, sorry: def shell_escape(Arg) : returns Arg suitably escaped for use as a command-line argument to Bash.

Re: Multiple equates

2008-12-03 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Cameron Laird wrote: def shell_escape(Arg) : returns Arg suitably escaped for use as a command-line argument to Bash. pattern = r['\|\\$\#\;\(\)\[\]\{\}\`\!\~\ \\] def f1(Match): return \\ + Match.group(0) return

Re: Multiple equates

2008-12-03 Thread Jeremiah Dodds
On Wed, Dec 3, 2008 at 6:23 AM, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: So why is that better? -- http://mail.python.org/mailman/listinfo/python-list I personally think that it looks marginally cleaner (indentation issues aside). Do you think it's substantially worse? If so, why? I

Re: Multiple equates

2008-12-03 Thread Almar Klein
Hi, what about numpy? import numpy a = numpy.ones((10,),dtype=numpy.bool) I = [1,3,8] a[I]=False print a gives: [ True False True False True True True True False True] Almar -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple equates

2008-12-03 Thread Cameron Laird
In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Cameron Laird wrote: def shell_escape(Arg) : returns Arg suitably escaped for use as a command-line argument to Bash. pattern =

Re: Multiple equates

2008-12-03 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Cameron Laird wrote: There's a realm within Pythonia that favors lambdalessness. Why is that? Was Rossum frightened in his cradle by a lambda when he was a baby? Are some people afraid of lambdas the way others are afraid of spiders? --

Re: Multiple equates

2008-12-03 Thread alex23
On Dec 4, 1:52 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: Why is that? Was Rossum frightened in his cradle by a lambda when he was a baby? Are some people afraid of lambdas the way others are afraid of spiders? Language designers are a superstitious and cowardly

Re: Multiple equates

2008-12-03 Thread Hendrik van Rooyen
Cameron Laird [EMAIL PROTECTED] wrote: There's a realm within Pythonia that favors lambdalessness. And who, may I ask, Is the King of this realm? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple equates

2008-12-02 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Cameron Laird wrote: In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Cameron Laird wrote: I've been trying to decide if there's any sober reason to advocate the one-liner map(lambda i: a.__setitem__(i, False), [x1, x2, x3,

Re: Multiple equates

2008-12-02 Thread Cameron Laird
In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Cameron Laird wrote: In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Cameron Laird wrote: I've been trying to decide if there's any sober reason to advocate

Re: Multiple equates

2008-11-26 Thread Cameron Laird
In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Cameron Laird wrote: I've been trying to decide if there's any sober reason to advocate the one-liner map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024]) Are lambdas like the Dark Side of Python?

Re: Multiple equates

2008-11-25 Thread Iain King
On Nov 17, 7:41 pm, Tim Chase [EMAIL PROTECTED] wrote: It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... a = [1,2,3,4,5] x1, x2 = 1, 3 a[x1] = a[x2] = False a [1, False, 3, False, 5]

Re: Multiple equates

2008-11-25 Thread Iain King
On Nov 25, 11:29 am, Iain King [EMAIL PROTECTED] wrote: On Nov 17, 7:41 pm, Tim Chase [EMAIL PROTECTED] wrote: It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... a = [1,2,3,4,5] x1,

Re: Multiple equates

2008-11-24 Thread Lawrence D'Oliveiro
Cameron Laird wrote: I've been trying to decide if there's any sober reason to advocate the one-liner map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024]) Are lambdas like the Dark Side of Python? :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple equates

2008-11-19 Thread Tim Roberts
jzakiya [EMAIL PROTECTED] wrote: I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? Answer: it does not matter. This is premature

Re: Multiple equates

2008-11-18 Thread CarlFK
On Nov 17, 2:54 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: In article [EMAIL PROTECTED], Tim Chase  [EMAIL PROTECTED] wrote:                         .                         .                         .To the OP, I think rather than cluttering my code, I'd just create a loop   for i

Multiple equates

2008-11-17 Thread jzakiya
I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? 1) array[x1]=array[x2]== array[x10] = \ array[x11]=array[x12]=... = array[x20]

Re: Multiple equates

2008-11-17 Thread Arnaud Delobelle
jzakiya [EMAIL PROTECTED] writes: I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? 1) array[x1]=array[x2]== array[x10] =

Re: Multiple equates

2008-11-17 Thread jzakiya
On Nov 17, 2:10 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: jzakiya [EMAIL PROTECTED] writes: I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or

Re: Multiple equates

2008-11-17 Thread Diez B. Roggisch
Arnaud Delobelle wrote: jzakiya [EMAIL PROTECTED] writes: I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? 1)

Re: Multiple equates

2008-11-17 Thread Tim Chase
It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... a = [1,2,3,4,5] x1, x2 = 1, 3 a[x1] = a[x2] = False a [1, False, 3, False, 5] Works for me. To the OP, I think rather than cluttering my code, I'd

Re: Multiple equates

2008-11-17 Thread Arnaud Delobelle
Arnaud Delobelle [EMAIL PROTECTED] writes: jzakiya [EMAIL PROTECTED] writes: I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? 1)

Re: Multiple equates

2008-11-17 Thread Cameron Laird
In article [EMAIL PROTECTED], Tim Chase [EMAIL PROTECTED] wrote: . . . To the OP, I think rather than cluttering my code, I'd just create a loop for i in [x1,x2,x3,x4,...x1024]: a[i] = False