Opened 9 years ago

Closed 9 years ago

#26250 closed Cleanup/optimization (wontfix)

Use a single string placeholder syntax for all user facing APIs

Reported by: Jon Dufresne Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Some Django APIs use the legacy % style placeholder syntax while others use the str.format() style syntax.

I think Django should pick one style and use it consistently for all user facing APIs.

For example:

str.format() syntax

Legacy % syntax

As success_url recently moved to str.format(), I'm guessing this is Django's preferred style?

I'm suggesting Django deprecate its use of the legacy % syntax in favor of str.format() syntax. I think this would create a greater API consistency throughout the framework.

django-developers discussion

Change History (2)

comment:1 by Tim Graham, 9 years ago

Component: UncategorizedCore (Other)
Triage Stage: UnreviewedSomeday/Maybe

Pending outcome of mailing discussion.

comment:2 by Claude Paroz, 9 years ago

Resolution: wontfix
Status: newclosed

In my opinion, the discussion didn't reveal any strong argument in favor of this move.

Summarizing James Bennett's post:

use format() in future commits if it's cleaner, or just adopt a policy of "if you're in there making a change and it won't break back compat, feel free to update to format() while you're at it".

Note: See TracTickets for help on using tickets.
Back to Top