keep a list of read and unread items
Stargaming
stargaming at gmail.com
Sun Aug 13 05:06:24 EDT 2006
Ant schrieb:
> a wrote:
>
>
>>i m building an rss reader and i want you suggestions for datastructure
>>for keeping read and unread list for each use
>>i m assuming it will be very sparse
>
>
> A dictionary for each site seems to be the obvious choice, mapping the
> article ID to True or False.
>
You could also write a class, let's say RSSEntry, with attributes like
"read", "title", "author", "content", "date" and everything you need.
Another class-way would be some class like RSSFeed, being a container
holding entries like RSSFeed[0] RSSFeed[1] etc., each again with
attributes like RSSFeed[0].author.
Those class instances can be pickle'd easily, so you don't have to
bother about any database or stuff.
More information about the Python-list
mailing list