RussBaz / enforce

Python 3.5+ runtime type checking for integration testing and data validation
543 stars 21 forks source link

Any should match against Lists #41

Closed brool closed 7 years ago

brool commented 7 years ago

On dev branch.

from typing import Any, List
import enforce

@enforce.runtime_validation
def foo(a: Any) -> Any:
    return 10

foo([10,20])

will result in

enforce.exceptions.RuntimeTypeError: 
  The following runtime type errors were encountered:
       Argument 'a' was not of type typing.Any. Actual type was typing.List[int].

Any should match against a List[int], I believe.

RussBaz commented 7 years ago

I think it was a regression, introduced in the last few patches, It is now fixed.

I hope there won't be any more regression any time soon =(

Thanks for the reporting!