Personally, I prefer some kind of escaping, possibly in the style ofI am genuinely interested in the ways to improve date/time formatting in
Python. There are certainly better ways than stftime. For example, ICU
has a date/time format syntax that is much more readable: instead of
"%Y-%m-%d %H:%M:%S", ICU format is "yyyy-MM-dd HH:mm:ss".
I don't think it is hard to find a way to introduce ICU format in
datetime.__format__ while preserving backward compatibility. For
example, we may require that % is always "escaped" as '%' in ICU format
and the presence of unescaped % can trigger strftime interpretation.
[1] http://userguide.icu-project.org/formatparse/datetime
.format, e.g. "{year}-{month}-{day} {hour}:{minute}:{second}". (It'll
probably need a little tinkering to shorten it! :-))