Re: List mapping question

2005-02-04 Thread TZOTZIOY
On Thu, 03 Feb 2005 17:27:05 -0500, rumours say that Marc Huffnagle <[EMAIL PROTECTED]> might have written: >Thanks ... so there's no way to pass an actual variable into a list >mapping, instead of its value? I guess I'm thinking of something the >equivalent of call by reference. No, there is

Re: List mapping question

2005-02-03 Thread Michael Spencer
Marc Huffnagle wrote: I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) It may not matter to you, at the moment, but a = int(a) is not strictly '

Re: List mapping question

2005-02-03 Thread Steven Bethard
Marc Huffnagle wrote: Steve Holden wrote: >>> a,b,c = 1.1, 2.2, 3.3 >>> a,b,c = map(int, (a,b,c)) >>> a,b,c (1, 2, 3) >>> a,b,c = [int(x) for x in (a,b,c)] >>> a,b,c (1, 2, 3) regards Steve Thanks ... so there's no way to pass an actual variable into a list mapping, instead of its value? I

Re: List mapping question

2005-02-03 Thread Steven Bethard
Marc Huffnagle wrote: I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b, c]] but that didn't work because it

Re: List mapping question

2005-02-03 Thread Marc Huffnagle
Steve Holden wrote: Marc Huffnagle wrote: I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b, c]] but that di

Re: List mapping question

2005-02-03 Thread Steve Holden
Marc Huffnagle wrote: I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b, c]] but that didn't work because it

List mapping question

2005-02-03 Thread Marc Huffnagle
I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b, c]] but that didn't work because it was creating a list with