|
a/Ming/ming/schema.py |
|
b/Ming/ming/schema.py |
|
... |
|
... |
140 |
types.MethodType,
|
140 |
types.MethodType,
|
141 |
types.BuiltinFunctionType)):
|
141 |
types.BuiltinFunctionType)):
|
142 |
return self.if_missing()
|
142 |
return self.if_missing()
|
143 |
else:
|
143 |
else:
|
144 |
return deepcopy(self.if_missing) # handle mutable defaults
|
144 |
return deepcopy(self.if_missing) # handle mutable defaults
|
|
|
145 |
try:
|
145 |
elif value == self.if_missing:
|
146 |
if value == self.if_missing:
|
146 |
return value
|
147 |
return value
|
|
|
148 |
except Invalid:
|
|
|
149 |
pass
|
147 |
return self._validate(value, **kw)
|
150 |
return self._validate(value, **kw)
|
148 |
|
151 |
|
149 |
def _validate(self, value, **kw): return value
|
152 |
def _validate(self, value, **kw): return value
|
150 |
|
153 |
|
151 |
class Anything(FancySchemaItem):
|
154 |
class Anything(FancySchemaItem):
|