Issue 7994: Make object.__format__() raise a PendingDeprecationWarning
if the format string is not empty. Manually merge r79596 and r84772
from 2.x.
Also, apparently test_format() from test_builtin never made it into
3.x. I've added it as well. It tests the basic format()
infrastructure.
diff --git a/Misc/NEWS b/Misc/NEWS
index 04f5799..0b86bc9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,14 @@
Core and Builtins
-----------------
+- Issue #7994: Issue a PendingDeprecationWarning if object.__format__
+ is called with a non-empty format string. This is an effort to
+ future-proof user code. If a derived class does not currently
+ implement __format__ but later adds its own __format__, it would
+ most likely break user code that had supplied a format string. This
+ will be changed to a DeprecationWaring in Python 3.3 and it will be
+ an error in Python 3.4.
+
- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
re-created on a subsequent call to Py_Initialize(). The problem (a crash)
wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.