dbapi2 select where IN (...)

2009-11-30 Thread yota.n...@gmail.com
hello, I couldn't find how the dbapi2 planned to handle the sql IN statement. ex : SELECT * FROM table WHERE num IN (2,3,8,9); I'd be glad to take advantage of the ? mechanism, but what about tuples ! execute(SELECT * FROM table WHERE num IN ?; , ((2,3,8,9),))...fail... what would be the

memoize again

2009-11-21 Thread yota.n...@gmail.com
I spent a lot of time looking for tips on how to properly write cache / memoize function. Testing, merging and fixing contributed but half finished pieces of code. Here is the summary of what I learned through a clean example, might it be useful for beginners. #!/usr/bin/env python3.1 (should