You are writing a comment about BossArray for list-like Yahoo search results, here is a quick summary:

I recently put together BossArray, which is a simple wrapper around the Yahoo BOSS search results (relying on the Yahoo BOSS Mashup Framework for the heavy lifting). It provides a dirt simple interface mimicking a normal Python list for most interaction.


You are responding to this comment written by Amaç Herdağdelen on November 15th 2008, 00:30.

Hi Will,

First of all thanks for the wrapper. It really made my life easier.

I think I may have found a small bug. When there are only two results and I want to access all of them the 64th line executes (there is one cached and one uncached result):

downloaded = [(index,self._download(index,1),)]
As far as I can see, _download itself returns a list. So in the end you get something like [(1, [here there is a single result])]. But it looks like you expect to get something like [(1, aSingleResult)]. To correct the issue, I modified the same line as follows:
downloaded = [(index,self._download(index,1)[0],)]
Now it seems to be working ok but I'm not sure if I broke something else or not. I'd really appreciate if you can confirm this.

Secondly, I have a question/suggestion: I want to group the result elements in sets. Whenever I index a particular result all of its set will be downloaded and cached. I.e: sets will be 0:50, 50:100, 100:150, ... Whenever I access a result like x[143] it should automatically download x[100:150] because 143 in in the range 100:150. That functionality would allow me to write a simple loop like:

from boss_array import BossArray
x = BossArray("Python")
["%s\n" % (r[abstract]) for r in x]
You may consider this as either a suggestion, or a question of where to start implementing it for myself.

Thanks again!

Amaç


Please be aware that comment forms go stale after one hour.





Comments may make use of LifeFlow MarkDown. Raw html will be escaped.


Quick Introduction to LifeFlow MarkDown Syntax

A highlighted code block:

@@ ruby
def a (b, c):
  b * c
end
@@

Other common languages work as well: scheme, python, java, html, etc.

Other markdown syntax:

 ### This is an h3 title
#### This is an h4 title
**this is bold**
*this is italics*

1. This is an
2. ordered list

* And an unordered
* list too

[this is a link](http://www.lethain.com/ "Lethain")