[PEAK] Patch to clear RuleSet

Phillip J. Eby pje at telecommunity.com
Tue Jul 15 11:05:30 EDT 2008


At 01:58 PM 7/9/2008 +0200, Alberto Valverde wrote:
>Hi Phillip,
>
>It has been requested in turbogears-trunk [1] for a mechanism to clear
>all rules in a generic function like the old RuleDispatch's
>GenericFunction.clear() method. I've created a patch against the latest
>trunk that implements this. Maybe you want to consider adding it.

Actually, I'd prefer to add a RuleSet.clear() method, so you could 
use rules_for(func).clear() in that case, rather than having a 
standalone function.

It also appears to me that RuleSet.__iter__ is broken, in that it 
really should hold the lock for the entire iteration, as it's not 
threadsafe otherwise.  :(  So, certainly the remove() operation 
should be atomic too.




More information about the PEAK mailing list