Quote:
Originally Posted by chaley
Good idea. I have used the calibre built-in version of this function many times. Are you using it to do the implementation? It is calibre.db.cache.get_categories. It supports a list of book ids, does caching, and has several other optimizations. It returns a dict
|
Yes. I am using this for the function. I wouldn't have done it without the get_categories().
Quote:
Originally Posted by chaley
I can do this. The big question is how? What I would prefer to do is extend the language for the for statement, making its grammar
Code:
'for' varname 'in' expression ['separator' expression] ':'
|
I leave this to you. What you suggests would work nicely for me.
Quote:
Originally Posted by chaley
Specifying the separator is optional. OK with you?
|
Definitely. It is better not to force people to specify the separator every time unnecessarily.
Quote:
Originally Posted by chaley
However, I realize that this use of list_union is rather esoteric, so I will add the function
Code:
list_remove_duplicates(list, sep)
If you think that list_uniq(), or perhaps list_unique(), is a better name than I can use that.
|
Yours seems more descriptive and better.