chiark / gitweb /
documentation/python: repro case for another Py3.6-specific typing thing.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 10:25:00 +0000 (12:25 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 10:25:00 +0000 (12:25 +0200)
documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html [new file with mode: 0644]
documentation/test_python/inspect_annotations/inspect_annotations.py
documentation/test_python/test_inspect.py

diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html
new file mode 100644 (file)
index 0000000..4a447c3
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>inspect_annotations.AContainer | 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>
+  </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_annotations.html">inspect_annotations</a>.<wbr/></span>AContainer <span class="m-thin">class</span>
+        </h1>
+        <p>A generic class. No parent class info extracted yet.</p>
+        <div class="m-block m-default">
+          <h3>Contents</h3>
+          <ul>
+            <li>
+              Reference
+              <ul>
+                <li><a href="#dunder-methods">Special methods</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div>
+        <section id="dunder-methods">
+          <h2><a href="#dunder-methods">Special methods</a></h2>
+          <dl class="m-doc">
+            <dt id="__class_getitem__">
+              <span class="m-doc-wrap-bumper">def <a href="#__class_getitem__" class="m-doc-self">__class_getitem__</a>(</span><span class="m-doc-wrap">params)</span>
+            </dt>
+            <dd></dd>
+            <dt id="__init_subclass__">
+              <span class="m-doc-wrap-bumper">def <a href="#__init_subclass__" class="m-doc-self">__init_subclass__</a>(</span><span class="m-doc-wrap">*args, **kwargs)</span>
+            </dt>
+            <dd></dd>
+            <dt id="__new__">
+              <span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
+            </dt>
+            <dd></dd>
+          </dl>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
index b7e8218b7bacc3d443b2499bdce093cb51eb274c..9c84809402fba8c8e91216235c2fb2f3bb8ce600 100644 (file)
@@ -23,6 +23,8 @@ _T = TypeVar('Tp')
 
 # Triggers a corner case with _gorg on Py3.6 (the member has to be ignored).
 # AContainer2 is not derived directly from Generic but has _gorg also.
+# Additionally, on Py3.6 these classes will have a __next_in_mro__ member,
+# which should be ignored as well
 class AContainer(Generic[_T]):
     """A generic class. No parent class info extracted yet."""
 class AContainer2(Iterator):
index 4fed48f324d0f0f64d90c5ae35e099ccfbeef995..b198c740f6a404f8469575ae2540275cadfb529b 100644 (file)
@@ -89,6 +89,9 @@ class Annotations(BaseInspectTestCase):
         self.assertEqual(*self.actual_expected_contents('inspect_annotations.Foo.html'))
         self.assertEqual(*self.actual_expected_contents('inspect_annotations.FooSlots.html'))
 
+        # This should not list any internal stuff from the typing module
+        self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html'))
+
     # https://github.com/python/cpython/pull/13394
     @unittest.skipUnless(LooseVersion(sys.version) >= LooseVersion('3.7.4'),
         "signature with / for pow() is not present in 3.6, "