]> granicus.if.org Git - python/commitdiff
+ Display property functions in the same order they're specified to
authorTim Peters <tim.peters@gmail.com>
Tue, 25 Sep 2001 06:30:51 +0000 (06:30 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 25 Sep 2001 06:30:51 +0000 (06:30 +0000)
  property() (get, set, del; not set, get, del).

+ Change "Data defined/inherited in ..." header lines to
  "Data and non-method functions defined/inherited in ...".  Things like
  the value of __class__, and __new__, and class vrbls like the i in
      class C:
          i = int
  show up in this section too.  I don't think it's worth a separate
  section to distinguish them from non-callable attrs, and there's no
  obvious reliable way to distinguish callable from non-callable attrs
  anyway.

Lib/pydoc.py

index 78ec71439f80180df67c59ab2d80e6f6354afb4d..a6f026bcb23e155a2cd504e31643e575880154f9 100755 (executable)
@@ -646,8 +646,8 @@ TT { font-family: lucidatypewriter, lucida console, courier }
                         doc = self.markup(value.__doc__, self.preformat,
                                           funcs, classes, mdict)
                         push('<dd><tt>%s</tt></dd>\n' % doc)
-                    for attr, tag in [("fset", " setter"),
-                                      ("fget", " getter"),
+                    for attr, tag in [("fget", " getter"),
+                                      ("fset", " setter"),
                                       ("fdel", " deleter")]:
                         func = getattr(value, attr)
                         if func is not None:
@@ -713,7 +713,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
                           lambda t: t[1] == 'static method')
             attrs = spillproperties("Properties %s" % tag, attrs,
                                     lambda t: t[1] == 'property')
-            attrs = spilldata("Data %s" % tag, attrs,
+            attrs = spilldata("Data and non-method functions %s" % tag, attrs,
                               lambda t: t[1] == 'data')
             assert attrs == []
 
@@ -1030,8 +1030,8 @@ class TextDoc(Doc):
                     if doc:
                         push(self.indent(doc))
                         need_blank_after_doc = 1
-                    for attr, tag in [("fset", " setter"),
-                                      ("fget", " getter"),
+                    for attr, tag in [("fget", " getter"),
+                                      ("fset", " setter"),
                                       ("fdel", " deleter")]:
                         func = getattr(value, attr)
                         if func is not None:
@@ -1081,8 +1081,8 @@ class TextDoc(Doc):
                           lambda t: t[1] == 'static method')
             attrs = spillproperties("Properties %s:\n" % tag, attrs,
                                     lambda t: t[1] == 'property')
-            attrs = spilldata("Data %s:\n" % tag, attrs,
-                              lambda t: t[1] == 'data')
+            attrs = spilldata("Data and non-method functions %s:\n" % tag,
+                              attrs, lambda t: t[1] == 'data')
             assert attrs == []
 
             # Split off the attributes inherited from the next class (note