[Python-checkins] cpython (3.2): #17351: remove "object" inheritance from docs. Patch by Phil Elson.

ezio.melotti python-checkins at python.org
Mon Mar 11 08:43:41 CET 2013


http://hg.python.org/cpython/rev/4f745f7d6fca
changeset: 82601:4f745f7d6fca
branch: 3.2
parent: 82595:222505a5aeac
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Mon Mar 11 09:30:21 2013 +0200
summary:
 #17351: remove "object" inheritance from docs. Patch by Phil Elson.
files:
 Doc/howto/descriptor.rst | 6 +++---
 Doc/howto/logging-cookbook.rst | 6 +++---
 Doc/howto/sorting.rst | 2 +-
 Doc/library/functions.rst | 2 +-
 Misc/ACKS | 1 +
 5 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -224,17 +224,17 @@
 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
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -1036,7 +1036,7 @@
 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
@@ -1045,7 +1045,7 @@
 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
@@ -1345,7 +1345,7 @@
 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,
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -225,7 +225,7 @@
 
 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):
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -317,7 +317,7 @@
 ['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()
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -303,6 +303,7 @@
 Andrew Eland
 Julien Élie
 Lance Ellinghaus
+Phil Elson
 David Ely
 Jeff Epler
 Tom Epperly
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /