diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2010-04-30 13:47:34 +0000 |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2010-04-30 13:47:34 +0000 |
commit | c4ae73e5f705eb7abe267e9424d25a232d89f7c1 (patch) | |
tree | 8e29c33fe69b308f404d31ccbfb09063812dc1c3 | |
parent | b3437c9f95b20e1ada5b51f3f6242cb708b53b91 (diff) | |
download | cpython-git-c4ae73e5f705eb7abe267e9424d25a232d89f7c1.tar.gz |
Add item
-rw-r--r-- | Doc/whatsnew/2.7.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index f9d35b76a8..6fefe1bf48 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -545,6 +545,16 @@ Some smaller changes made to the core Python language are: so it will now produce 'INF' and 'NAN'. (Contributed by Eric Smith; :issue:`3382`.) + A low-level change: the :meth:`object.__format__` method now triggers + a :exc:`PendingDeprecationWarning` if it's passed a format string, + because the :meth:`__format__` method for :class:`object` converts + the object to a string representation and formats that. The method + used to silently apply the format string to the string + representation, but that could hide mistakes in Python code. If + you're supplying formatting information such as an alignment or + precision, presumably you're expecting the formatting to be applied + in some object-specific way. (Fixed by Eric Smith; :issue:`7994`.) + * The :func:`int` and :func:`long` types gained a ``bit_length`` method that returns the number of bits necessary to represent its argument in binary:: |