On Wed, 01 Dec 2010 05:33:55 -0800, Gnarlodious wrote:
> Thanks for all the ideas, I've resigned myself to unpacking a tuple and
> reassembling it.
You make it sound like that's an onerous task.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Gnarlodious wrote:
On Dec 1, 6:23 am, Jean-Michel Pichavant
wrote:
what about
def query():
return ["Formating only {0} into a string".format(sendList()[0])] +
sendList()[1:]
However this solution calls sendList() twice, which is too processor
intensive.
You got to get rid of
On Dec 1, 6:23 am, Jean-Michel Pichavant
wrote:
> what about
>
> def query():
> return ["Formating only {0} into a string".format(sendList()[0])] +
> sendList()[1:]
However this solution calls sendList() twice, which is too processor
intensive.
Thanks for all the ideas, I've resigned myself
Gnarlodious wrote:
This works for me:
def sendList():
return ["item0", "item1"]
def query():
l=sendList()
return ["Formatting only {0} into a string".format(l[0]), l[1]]
query()
However, is there a way to bypass the
l=sendList()
and change one
On Wed, 01 Dec 2010 08:54:49 +, Steven D'Aprano wrote:
> An alternative would be:
>
Please ignore. That was an accidental Send mid-edit.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 30 Nov 2010 17:08:57 -0800, Gnarlodious wrote:
> This works for me:
>
> def sendList():
> return ["item0", "item1"]
>
> def query():
> l=sendList()
> return ["Formatting only {0} into a string".format(l[0]), l[1]]
For the record, you're not actually changing a list in place
g only {0} into a string".format(l[0]), l[1]]
>>
>> query()
>>
>>
>> However, is there a way to bypass the
>>
>> l=sendList()
>>
>> and change one list item in-place? Possibly a list comprehension
>> operating on a numbered item?
>
Thanks.
Unless someone has a simpler solution, I'll stick with 2 lines.
-- Gnarlie
--
http://mail.python.org/mailman/listinfo/python-list
On 01/12/2010 01:08, Gnarlodious wrote:
This works for me:
def sendList():
return ["item0", "item1"]
def query():
l=sendList()
return ["Formatting only {0} into a string".format(l[0]), l[1]]
query()
However, is there a way to bypass the
l=sendLi
This works for me:
def sendList():
return ["item0", "item1"]
def query():
l=sendList()
return ["Formatting only {0} into a string".format(l[0]), l[1]]
query()
However, is there a way to bypass the
l=sendList()
and change one list item in-place?
10 matches
Mail list logo