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.
Change History (2)
comment:1 by , 9 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Triage Stage: | Unreviewed → Someday/Maybe |
comment:2 by , 9 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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".
Pending outcome of mailing discussion.