Help Topics for infer_type

Sample CLI

gway infer-type

Signature

(value, default=None, **types)

Docstring

Try casting `value` to each provided type. If a cast succeeds, returns the corresponding key (name). If none succeed, returns default. Example: gw.infer_type("42", INTEGER=int, REAL=float) # => "INTEGER" gw.infer_type("hello", INTEGER=int, default="TEXT") # => "TEXT"