added partial check for Dynamic type

This commit is contained in:
nickharris 2018-05-11 17:17:27 -06:00
parent 12d4dab774
commit b1dbcedd6b

View File

@ -1,4 +1,5 @@
import inspect
from functools import partial
from .mountedtype import MountedType
@ -11,7 +12,7 @@ class Dynamic(MountedType):
def __init__(self, type, with_schema=False, _creation_counter=None):
super(Dynamic, self).__init__(_creation_counter=_creation_counter)
assert inspect.isfunction(type)
assert inspect.isfunction(type) or isinstance(type, partial)
self.type = type
self.with_schema = with_schema