On Fri, Aug 24, 2012 at 10:30 AM, Daniel Swarbrick
<daniel.swarbr...@gmail.com> wrote:
> On 24 August 2012 18:12, Carl Meyer <c...@oddbird.net> wrote:
>> Can you link to where in the current docs it specifies that %-formatting
>> is deprecated and/or will be removed? I can't even find, on a cursory
>> search, where it says the new .format() style should be preferred.
>
> It's not easy to find - I've only found the mention of the impending
> deprecation in the Python 3.0 "What's New" docs -
> http://docs.python.org/release/3.0/whatsnew/3.0.html#pep-3101-a-new-approach-to-string-formatting
>
> However, I can't find followup references to that in the Python 3.1
> docs. Maybe the decision was rescinded? Personally I didn't really see
> anything majorly wrong with the %-style formatting. Being a C
> developer myself, it was nice to have some common ground and not have
> to go hunting for format string specifications.
>
> This section http://docs.python.org/library/stdtypes.html#str.format
> states "This method of string formatting is the new standard in Python
> 3, and should be preferred to the % formatting described in String
> Formatting Operations in new code."
>
> I just thought that if the %-style formatting is indeed earmarked for
> removal, maybe we should start using the new format sooner rather than
> later.

This post by Guido is informative on the subject, even though it's
nearly three years old now:

http://mail.python.org/pipermail/python-dev/2009-September/092399.html

The 3.2 docs specifically say, "As the new String Formatting syntax is
more flexible and handles tuples and dictionaries naturally, it is
recommended for new code. However, there are no current plans to
deprecate printf-style formatting."  The 3.3 docs no longer have this
quote, but they also indicate nothing about planned deprecation or
removal.

Until the Python developers announce an actual timeline for removal
(if they ever do), I can't see any reason for Django to be concerned
about which formatting approach to use, apart from the immediate
concerns of style and efficiency.

Cheers,
Ian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to