[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Thank you, Mike. Hmm... I tried exactly that technique, the last time I found myself with a similar need, a year or two ago. I seem to remember it only caused the problem to regress one step farther. But I must have missed something and will probably give it another shot. Any suggestions on

Re: [sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Michael Bayer
its probably easier to use __missing__ - see attached. On Mar 13, 2011, at 4:26 AM, Eric Ongerth wrote: Thank you, Mike. Hmm... I tried exactly that technique, the last time I found myself with a similar need, a year or two ago. I seem to remember it only caused the problem to regress

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Cool! I was unaware of __missing__. Thanks again. On Mar 13, 10:24 am, Michael Bayer mike...@zzzcomputing.com wrote: its probably easier to use __missing__ - see attached.  dict_of_sets_with_default.py 1KViewDownload On Mar 13, 2011, at 4:26 AM, Eric Ongerth wrote: Thank you, Mike.  

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Ah, brilliant! So now I'm analyzing what prevented me from coming up with that solution before it looks like my problem, or mental block, was that I was trying to find a magic incantation to allow me to get the whole dict-of-set behavior defined from the A class, rather than allowing it to be