Open kevinboulain opened 6 years ago
I seem to get the same exception when using typing.Sequence
instead of typing.List
from typing import Sequence
from enforce import runtime_validation, config
config(dict(mode='covariant')) # by the way, so sad that this is not the default :)
@runtime_validation
def foo(s: Sequence[str]):
pass
foo(['a']) # TypeError: Only generics can be wrapped in GenericProxy
As requested, I am opening this issue instead of #44.
Seen with enforce
0.3.4
.Example code with a generator:
An exception will occur in enforce:
There is a similar problem when a function returns a
Coroutine
.This seems normal for now as there isn't any real support for these objects.