> That would be an alternative to monkey-patching and much cleaner, but as
> Gustavo already objected, this will not change the existing predicates
> in repoze.what. So we would need to provide a subclass for every
> existing predicate in our own predicates module.
>
> -- Christoph
It shouldn't be too hard, to manipulate all these classes on the fly:
from repoze.what import predicates
def issubclass_safe(A,B):
try:
return issubclass(A,B)
except TypeError:
return False
for (n,p) in predicates.__dict__.items():
if issubclass_safe(p, predicates.Predicate):
class c(p):
foo=3
c.__name__=n
print c, c.foo
globals()[n]=c
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---