3 ms·
> I wonder whether the authors consider "value = somedict.get('somekey')" or "match_object = re.search(pattern, somestring)" as returning a single type. Both of
by leovonl 10y ago
> I wonder whether the authors consider "value = somedict.get('somekey')" or "match_object = re.search(pattern, somestring)" as returning a single type. Both of those common calls can return None.
val get: 'a dict -> 'a -> 'b option
val search: re -> string -> match option
Above is an hypotetical type notation in OCaml for both functions. I think it pretty much covers everything.