IS_EXPR(lambda value: None(=)

This commit is contained in:
Massimo
2013-02-15 10:51:30 -06:00
parent 5618350c0b
commit 564f07e354
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -237,6 +237,9 @@ class IS_EXPR(Validator):
self.environment = environment or {}
def __call__(self, value):
if callable(self.expression):
return (value, self.expression(value))
# for backward compatibility
self.environment.update(value=value)
exec '__ret__=' + self.expression in self.environment
if self.environment['__ret__']: