In terms of API, assuming functions, I think there are two basic models. We could have two (or more) functions that were related though:# E.g. pat_with_names = "{foo:f}/{bar:4s}/{baz:3d}"matches = scan_to_obj(pat_with_names, haystack)# something like (different match objects are possible choices, dict, dataclass, etc)print(matches.foo)print(maches['bar'])# pat_only = "{:f}/{:4s}/{:3d}"foo, bar, baz = scan_to_tuple(pat_only, haystack)# names, if bound, have the types indicated by scanning languageHmm, if the above is acceptable, maybe f-strings are still the logical next step, since they bring the format and the target name together again.