| hays | but days is a heap |
| LeedsHK | wtf is a heap? |
| squigly | I was planing to say here is the python tutorial, here is the thinking in python, make some thing does some thing. |
| ironfroggy | no one ever uses heapq |
| TFKyle | that works |
| squigly | I think most of my libraries arnt especially useful to learn with |
| triplah_w | it doesnt look like you need a heap |
| TFKyle | squigly: he doesn't know python at all? |
| arkanes | I don't see any usage of the heap propery there |
| triplah_w | hays: let me just say, that's a very haskellish way of approaching it hehe |
| hays | well the file dates are in reverse order, but I assumed that they might not be in order |
| arkanes | hays: you can sort lists without making them heaps |
| hays | but inside the heap is actually more useful |
| ironfroggy | yeah just read the list and then sort it |
| hays | sure but inside I actually use a heap |
| triplah_w | inside what? |
| hays | because I need to sell all positions which have made 6% |
| triplah_w | you dont need the heap.... is there a clear reason why you are using it? hmm |
| squigly | TFKyle, no she doesnt |
| hays | for day in sort(days)? |
| squigly | but i dont hold that against them |
| arkanes | a tuple rather than a list for the linelist would be slightly more idiomatic as well as unpacking rather than indexing |
| hays | arkanes: how do I make a tuple? I only know about split |
| arkanes | its really more of a datafile problem and actually since you have to split() it, may as well leave it as a list |
| ironfroggy | i wouldnt worry about that, split returns a list, so just use it. but unpacking is definately a good idea |
| hays | unpacking? |
| arkanes | In general, I find indexing in python to be a smell hays: python can unpack sequences into variables a,b,c = (1,2,3) sets a=1 and so on hays: even if you decide to keep the heap, you can just use while days: and while shares: without the explit test the empty list is False in a boolean context |
| hays | too many values to unpack.. hmm |
| arkanes | the variables need to match the sequence if you only want, say, the first 3 of an abritrary length, you can slice the seqence |