Commits

Ezio Melotti  committed 4f745f7

#17351: remove "object" inheritance from docs. Patch by Phil Elson.

  • Participants
  • Parent commits 222505a
  • Branches 3.2

Comments (0)

Files changed (5)

File Doc/howto/descriptor.rst

             if obj is None:
                 return self
             if self.fget is None:
-                raise AttributeError, "unreadable attribute"
+                raise AttributeError("unreadable attribute")
             return self.fget(obj)
 
         def __set__(self, obj, value):
             if self.fset is None:
-                raise AttributeError, "can't set attribute"
+                raise AttributeError("can't set attribute")
             self.fset(obj, value)
 
         def __delete__(self, obj):
             if self.fdel is None:
-                raise AttributeError, "can't delete attribute"
+                raise AttributeError("can't delete attribute")
             self.fdel(obj)
 
 The :func:`property` builtin helps whenever a user interface has granted

File Doc/howto/logging-cookbook.rst

 call ``str()`` on that object to get the actual format string. Consider the
 following two classes::
 
-    class BraceMessage(object):
+    class BraceMessage:
         def __init__(self, fmt, *args, **kwargs):
             self.fmt = fmt
             self.args = args
         def __str__(self):
             return self.fmt.format(*self.args, **self.kwargs)
 
-    class DollarMessage(object):
+    class DollarMessage:
         def __init__(self, fmt, **kwargs):
             self.fmt = fmt
             self.kwargs = kwargs
     import random
     import time
 
-    class MyHandler(object):
+    class MyHandler:
         """
         A simple handler for logging events. It runs in the listener process and
         dispatches events to loggers based on the name in the received record,

File Doc/howto/sorting.rst

 
     def cmp_to_key(mycmp):
         'Convert a cmp= function into a key= function'
-        class K(object):
+        class K:
             def __init__(self, obj, *args):
                 self.obj = obj
             def __lt__(self, other):

File Doc/library/functions.rst

       ['Struct', '__builtins__', '__doc__', '__file__', '__name__',
        '__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
        'unpack', 'unpack_from']
-      >>> class Shape(object):
+      >>> class Shape:
               def __dir__(self):
                   return ['area', 'perimeter', 'location']
       >>> s = Shape()
 Andrew Eland
 Julien Élie
 Lance Ellinghaus
+Phil Elson
 David Ely
 Jeff Epler
 Tom Epperly