3 ms·
I wasn't actually trying to make a statement about type systems. To translate my example to python: def getFileHandleOrNone(filename, config): ...
by yummyfajitas 14y ago
I wasn't actually trying to make a statement about type systems. To translate my example to python:
def getFileHandleOrNone(filename, config):
...
def foo(filename, config):
"""get file handle or none,
based on context and filesystem"""
You are correct that the type system also provides documentation, but so does giving your methods a name indicating what you want them to do.