In the original proposal, we defined am_pm_names, month_names, and so on as functions. The idea of making them functions is that it makes it easy to wrap translations/localization tools around it. For example, with the current API, if we were to integrate it with Gettext, we would need 12 lookups every time we format a date to retrieve only the month names. The anonymous function would allow us to do that lazily, which would be more efficient.
Shall we move the options to the proposed API in the document? One option is to allow both lists and anonymous functions (but we should default to anonymous functions working with tuples as in the proposal, as that is more efficient).
Hi @GuSilverFlame,
In the original proposal, we defined
am_pm_names
,month_names
, and so on as functions. The idea of making them functions is that it makes it easy to wrap translations/localization tools around it. For example, with the current API, if we were to integrate it with Gettext, we would need 12 lookups every time we format a date to retrieve only the month names. The anonymous function would allow us to do that lazily, which would be more efficient.Shall we move the options to the proposed API in the document? One option is to allow both lists and anonymous functions (but we should default to anonymous functions working with tuples as in the proposal, as that is more efficient).