Changes between Initial Version and Version 2 of Ticket #28810


Ignore:
Timestamp:
Nov 17, 2017, 5:00:24 PM (7 years ago)
Author:
Tim Graham
Comment:

I'm not sure why you say "Python 3-esque str.format" in the description. str.format() was added in Python 2.6. I see that logging support for that style (by using style='{') was added in Python 3.2.

I'm not opposed to the change, as it seems like a slight readability enhancement, although generally I think there's a consensus against using mandating str.format() usage everwhere in Django and prohibiting the %s syntax. I think there was a ticket but I can't find it at the moment.

My only concern with the proposal is whether it could break backwards compatibility. I see an update to ServerFormatter.uses_server_time() was required. I'm not sure if it's likely that user code may make similar assumptions about the format string.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28810 – Description

    initial v2  
    1 We currently use the ``%(foo)s`` style in Django and in docs.  This "smells" quite Python 2.x when there is a ``str.format`` variety that uses, eg. ``{foo}``.
     1We currently use the `%(foo)s` style in Django and in docs.  This "smells" quite Python 2.x when there is a `str.format` variety that uses, eg. `{foo}`.
Back to Top