]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #28385: An error message when non-empty format spec is passed to
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 30 Oct 2016 17:37:46 +0000 (19:37 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 30 Oct 2016 17:37:46 +0000 (19:37 +0200)
object.__format__ now contains the name of actual type.

1  2 
Lib/test/test_builtin.py
Lib/test/test_bytes.py
Objects/typeobject.c

Simple merge
Simple merge
index bfbeb40d2c7bbddda155df98eb17a004b8ba9e8a,d65fcde25f7e64ed6f15ec89c85cb97f4f4d0965..9836961bc09681ecfa829f3c8240ff590aab3a16
@@@ -4380,25 -4318,6 +4380,18 @@@ PyDoc_STRVAR(object_subclasshook_doc
  "NotImplemented, the normal algorithm is used.  Otherwise, it\n"
  "overrides the normal algorithm (and the outcome is cached).\n");
  
- /*
-    from PEP 3101, this code implements:
-    class object:
-        def __format__(self, format_spec):
-            return format(str(self), format_spec)
- */
 +static PyObject *
 +object_init_subclass(PyObject *cls, PyObject *arg)
 +{
 +    Py_RETURN_NONE;
 +}
 +
 +PyDoc_STRVAR(object_init_subclass_doc,
 +"This method is called when a class is subclassed.\n"
 +"\n"
 +"The default implementation does nothing. It may be\n"
 +"overridden to extend subclasses.\n");
 +
  static PyObject *
  object_format(PyObject *self, PyObject *args)
  {