Context
The time module has a function to_time() which actually formats a string into a timestamp. The name reads like "convert something to a time value" but in practice it is the inverse of to_iso() / format(). This is misleading.
Proposal
Rename to_time() to to_clock(). time.parse(str) reads correctly and matches the convention of other parsing functions across the stdlib.
Not changing
to_iso() — correctly named (converts timestamp to ISO string)
format() — correctly named
date() — correctly named (specialized format shortcut)
An earlier audit flagged these as overlapping; on second look they are just convenience shortcuts around format(), which is fine. No redundancy to address.
Context
The time module has a function
to_time()which actually formats a string into a timestamp. The name reads like "convert something to a time value" but in practice it is the inverse ofto_iso()/format(). This is misleading.Proposal
Rename
to_time()toto_clock().time.parse(str)reads correctly and matches the convention of other parsing functions across the stdlib.Not changing
to_iso()— correctly named (converts timestamp to ISO string)format()— correctly nameddate()— correctly named (specialized format shortcut)An earlier audit flagged these as overlapping; on second look they are just convenience shortcuts around
format(), which is fine. No redundancy to address.