Closed gezakiss7 closed 9 years ago
It's only a workaround, but note that
:type in_file: isinstance(file)
will work correctly (i.e. you won't get e.g. ParseSyntaxException: Unknown identifier 'file'. Did you mean 'finite'?
and non-file
arguments will be rejected).
Is there a way to specify that a parameter's type is file in the docstring? The expression ":type in_file: file" does not work, nor do other formats I could think of. (Note that the decorator "@contract(in_file=file)" works, but I'd like to use the docstring.)