Open chrisimcevoy opened 1 month ago
That said, this needs to fit into a wider discussion around CultureInfo
usage and what exactly we want to expose publicly...
There are some types like Duration
where the tests don't seem to explicitly cover IFormattable.ToString()
, or even object.ToString()
, explicitly.
I suspect the coverage comes from this section of code in Noda Time.
It's currently a TODO in Pyoda Time, so we'll wanna implement that too if an IFormattable
protocol materialises in the codebase.
152 added a TODO because python's
__format__
allows us to specify aformat_spec
(which in the context of Pyoda Time constitutes a "pattern", standard or otherwise).What it doesn't allow us to do is specify a
CultureInfo
, naturally.Maybe we should implement a
def to_string(self, pattern, format_provider)
equivalent toIFormattable.ToString()
?