cpython: 4f745f7d6fca (original) (raw)
Mercurial > cpython
changeset 82601:4f745f7d6fca 3.2
#17351: remove "object" inheritance from docs. Patch by Phil Elson. [#17351]
Ezio Melotti ezio.melotti@gmail.com | |
---|---|
date | Mon, 11 Mar 2013 09:30:21 +0200 |
parents | 222505a5aeac |
children | 8b1d3fa3b389 e37647470fcf |
files | Doc/howto/descriptor.rst Doc/howto/logging-cookbook.rst Doc/howto/sorting.rst Doc/library/functions.rst Misc/ACKS |
diffstat | 5 files changed, 9 insertions(+), 8 deletions(-)[+] [-] Doc/howto/descriptor.rst 6 Doc/howto/logging-cookbook.rst 6 Doc/howto/sorting.rst 2 Doc/library/functions.rst 2 Misc/ACKS 1 |
line wrap: on
line diff
--- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -224,17 +224,17 @@ here is a pure Python equivalent:: if obj is None: return self if self.fget is None:
raise AttributeError, "unreadable attribute"[](#l1.7)
raise AttributeError("unreadable attribute")[](#l1.8) return self.fget(obj)[](#l1.9)
def set(self, obj, value): if self.fset is None:
raise AttributeError, "can't set attribute"[](#l1.13)
raise AttributeError("can't set attribute")[](#l1.14) self.fset(obj, value)[](#l1.15)
def delete(self, obj): if self.fdel is None:
raise AttributeError, "can't delete attribute"[](#l1.19)
raise AttributeError("can't delete attribute")[](#l1.20) self.fdel(obj)[](#l1.21)
The :func:property
builtin helps whenever a user interface has granted
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -1036,7 +1036,7 @@ arbitrary object as a message format str
call str()
on that object to get the actual format string. Consider the
following two classes::
@@ -1045,7 +1045,7 @@ following two classes:: def str(self): return self.fmt.format(*self.args, **self.kwargs)
@@ -1345,7 +1345,7 @@ works:: import random import time
- 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,
--- a/Doc/howto/sorting.rst +++ b/Doc/howto/sorting.rst @@ -225,7 +225,7 @@ function. The following wrapper makes th def cmp_to_key(mycmp): 'Convert a cmp= function into a key= function'
class K(object):[](#l3.7)
class K:[](#l3.8) def __init__(self, obj, *args):[](#l3.9) self.obj = obj[](#l3.10) def __lt__(self, other):[](#l3.11)
--- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -317,7 +317,7 @@ are always available. They are listed h ['Struct', '__builtins__', '__doc__', '__file__', '__name__', 'package', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into', 'unpack', 'unpack_from']
>>> class Shape(object):[](#l4.7)
>>> class Shape:[](#l4.8) def __dir__(self):[](#l4.9) return ['area', 'perimeter', 'location'][](#l4.10) >>> s = Shape()[](#l4.11)
--- a/Misc/ACKS +++ b/Misc/ACKS @@ -303,6 +303,7 @@ Eric Eisner Andrew Eland Julien Élie Lance Ellinghaus +Phil Elson David Ely Jeff Epler Tom Epperly