Python should drop custom formatters

I guess you considered

>>> '{0.year:4}-{0.month:02d}-{0.day:02}'.format(datetime.datetime.now())

It has the exact same length (3 times ’0.’ vs. ’_attrs’ suffix), is possible with current functionality, and extends to multiple arguments (e.g., for from/to dates). If you need date and time fields, the ’0.’ gets somewhat repetitive.

Can you please explain why you prefer format_attrs()?

I did consider that, yes.
I find the repetition of 0. to be a) irritating (on principle, it doesn’t feel DRY); b) strange/ugly (the syntax makes it look like trying to get those attributes from the integer 0, which would normally need parentheses); c) less expressive (I am trying to express the idea of “format this using a context defined by the datetime.datetime.now() result”).
However, my proposal doesn’t meaningfully save typing and is also less flexible (doesn’t combine with other arguments for the same template - I guess this can be considered an application of “namespaces are a honking great idea”).

I do still like the idea of datetime providing that kind of per-field formatting support (via creating actual abstractions for concepts like “month with name and number”). But that works independently of the format_attrs proposal. (That said, format_map itself exists for a reason, and treating attributes like a dictionary is a common enough goal in other contexts.)