Re: Change one list item in place
- From: Jean-Michel Pichavant <jeanmichel@xxxxxxxxxxx>
- Date: Wed, 01 Dec 2010 14:59:37 +0100
Gnarlodious wrote:
On Dec 1, 6:23 am, Jean-Michel Pichavant <jeanmic...@xxxxxxxxxxx>You got to get rid of those nerd habits of unecessary optimization. To put it simple, you just don't give a [put whatever suitable word] to the overhead of 2 calls of sendList instead of one.
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.
Until query is called a million time a second, there's no need to sacrifice anything on the optimization altar, because no one will never ever see the difference.
You can find my solution not that readable, that would be a proper reason for not using it. It's up to you.
JM
.
- References:
- Change one list item in place
- From: Gnarlodious
- Re: Change one list item in place
- From: Jean-Michel Pichavant
- Re: Change one list item in place
- From: Gnarlodious
- Change one list item in place
- Prev by Date: Re: How to initialize each multithreading Pool worker with an individual value?
- Next by Date: Re: strange TypeError exception in function compiled from a string
- Previous by thread: Re: Change one list item in place
- Next by thread: Re: Change one list item in place
- Index(es):