Ugh enough with those weird things already.
return out
+ # The properties can be defined using the low-level descriptor protocol
+ # instead of the higher-level property() decorator. That means there's no
+ # fget / fset / fdel, instead we need to look into __get__ / __set__ /
+ # __delete__ directly. This is fairly rare (datetime.date is one and
+ # BaseException.args is another I could find), so don't bother with it much
+ # --- assume readonly and no docstrings / annotations whatsoever.
+ if property.__class__.__name__ == 'getset_descriptor' and property.__class__.__module__ == 'builtins':
+ out.is_gettable = True
+ out.is_settable = False
+ out.is_deletable = False
+ out.summary = ''
+ out.has_details = False
+ out.type = None
+ return out
+
# TODO: external summary for properties
out.is_gettable = property.fget is not None
if property.fget or (property.fset and property.__doc__):
<li>class <a href="inspect_string.subpackage.Foo.html" class="m-doc">Foo</a> <span class="m-doc">A class in a subpackage. Shouldn't cause the module tree to have an expander for it.</span></li>
</ul>
</li>
+ <li>class <a href="inspect_string.DerivedException.html" class="m-doc">DerivedException</a> <span class="m-doc">A class deriving from BaseException, which has the weird args getset_descriptor</span></li>
<li class="m-doc-collapsible collapsed">
<a href="#" onclick="return toggle(this)">class</a> <a href="inspect_string.Foo.html" class="m-doc">Foo</a> <span class="m-doc">The foo class</span>
<ul class="m-doc">
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>inspect_string.DerivedException | My Python Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Python Project</a>
+ <div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
+ <a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
+ <a id="m-navbar-hide" href="#" title="Hide navigation"></a>
+ </div>
+ <div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
+ <div class="m-row">
+ <ol class="m-col-t-12 m-col-m-none">
+ <li><a href="modules.html">Modules</a></li>
+ <li><a href="classes.html">Classes</a></li>
+ </ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ <span class="m-breadcrumb"><a href="inspect_string.html">inspect_string</a>.<wbr/></span>DerivedException <span class="m-thin">class</span>
+ </h1>
+ <p>A class deriving from BaseException, which has the weird args getset_descriptor</p>
+ <div class="m-block m-default">
+ <h3>Contents</h3>
+ <ul>
+ <li>
+ Reference
+ <ul>
+ <li><a href="#methods">Methods</a></li>
+ <li><a href="#dunder-methods">Special methods</a></li>
+ <li><a href="#properties">Properties</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <section id="methods">
+ <h2><a href="#methods">Methods</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <span class="m-doc-wrap-bumper">def <a href="#with_traceback" class="m-doc-self" id="with_traceback">with_traceback</a>(</span><span class="m-doc-wrap">...)</span>
+ </dt>
+ <dd>Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.</dd>
+ </dl>
+ </section>
+ <section id="dunder-methods">
+ <h2><a href="#dunder-methods">Special methods</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <span class="m-doc-wrap-bumper">def <a href="#__reduce__" class="m-doc-self" id="__reduce__">__reduce__</a>(</span><span class="m-doc-wrap">...)</span>
+ </dt>
+ <dd></dd>
+ <dt>
+ <span class="m-doc-wrap-bumper">def <a href="#__setstate__" class="m-doc-self" id="__setstate__">__setstate__</a>(</span><span class="m-doc-wrap">...)</span>
+ </dt>
+ <dd></dd>
+ </dl>
+ </section>
+ <section id="properties">
+ <h2><a href="#properties">Properties</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <a href="#args" class="m-doc-self" id="args">args</a> <span class="m-label m-flat m-warning">get</span>
+ </dt>
+ <dd></dd>
+ </dl>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
<section id="classes">
<h2><a href="#classes">Classes</a></h2>
<dl class="m-doc">
+ <dt>class <a href="inspect_string.DerivedException.html" class="m-doc">DerivedException</a></dt>
+ <dd>A class deriving from BaseException, which has the weird args getset_descriptor</dd>
<dt>class <a href="inspect_string.Foo.html" class="m-doc">Foo</a></dt>
<dd>The foo class</dd>
<dt>class <a href="inspect_string.FooSlots.html" class="m-doc">FooSlots</a></dt>
__slots__ = ['first', 'second']
+class DerivedException(BaseException):
+ """A class deriving from BaseException, which has the weird args getset_descriptor"""
+
+ # Note: once we properly handle properties of base classes, we might want
+ # to import BaseException and add it to __all__ so it gets parsed directly
+
class Specials:
"""Special class members"""
self.assertEqual(*self.actual_expected_contents('inspect_string.another_module.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.Foo.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.FooSlots.html'))
+ self.assertEqual(*self.actual_expected_contents('inspect_string.DerivedException.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.Specials.html'))
self.assertEqual(*self.actual_expected_contents('classes.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.another_module.html', '../inspect_string/inspect_string.another_module.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.Foo.html', '../inspect_string/inspect_string.Foo.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.FooSlots.html', '../inspect_string/inspect_string.FooSlots.html'))
+ self.assertEqual(*self.actual_expected_contents('inspect_string.DerivedException.html', '../inspect_string/inspect_string.DerivedException.html'))
self.assertEqual(*self.actual_expected_contents('inspect_string.Specials.html', '../inspect_string/inspect_string.Specials.html'))
self.assertEqual(*self.actual_expected_contents('classes.html', '../inspect_string/classes.html'))