-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of generator/iterables/coroutines/... #47
Comments
Closed
I seem to get the same exception when using 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 |
smarie
added a commit
to smarie/enforce
that referenced
this issue
Jan 30, 2018
….Dict to typing.Mapping. Fixes RussBaz#52, Fixes RussBaz#51, fixes RussBaz#47
smarie
added a commit
to smarie/enforce
that referenced
this issue
Jan 30, 2018
….Dict to typing.Mapping. Fixes RussBaz#52, Fixes RussBaz#51, fixes RussBaz#47
smarie
added a commit
to smarie/enforce
that referenced
this issue
Jan 31, 2018
….Dict to typing.Mapping. Fixes RussBaz#52, Fixes RussBaz#51, fixes RussBaz#47
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: