Em Wed, Oct 29, 2014 at 01:47:15PM -0500, Guy Streeter escreveu:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/28/2014 05:01 PM, Guy Streeter wrote:
I'm making an effort to understand how all of tuna works (this is admirable, not folly, correct?). There's a part of the reload() function in the cpus class that I don't understand. to start with:
for socket in sockets_to_sort: self.sockets[socket].sort()
Here self.sockets[socket] is a list of cpu objects. The cpu class is not an orderable type. It does not provide it's own comparison function, and cannot be converted to an integer value. What is the (intended) result of calling the list's sort() function?
Another thing: these lines are indented so as to be included in the outer loop. It seems these lines need only to be run after the other loop is complete.
I think I must be missing something, since the code seems to work. Although, I can't find any place that depends on self.sockets[socket] being sorted in any meaningful way.
thanks, --Guy
I realize this isn't of high importance, but it's bugging me that I don't understand this bit of code. Does anyone have any insight?
It just that after all those years, I'm back where you are, i.e. having to go the code to try to figure out how it works, not a good sign, huh?
- Arnaldo