evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.07k stars 120 forks source link

Support for enforce library #364

Open ArneBachmann opened 6 years ago

ArneBachmann commented 6 years ago

Any plans to allow runtime type enforcing? I attempted to use the enforce decorator @runtime_validation but for the data types (coconut named tuples, while enforce expects typing.NamedTuple) I couldn't get it working.

Argument 'pinfo' was not of type <class 'sos.PathInfo'>. Actual type was untyped PathInfo

Do you have any opinion on supporting that or idea how to cope with it?

evhub commented 6 years ago

@ArneBachmann Can you show me exactly what code you're running that's giving you that error?

ArneBachmann commented 6 years ago

Looks like enforce requires a Python 3.5 and I cannot test it on this machine. Will check later.