chiark / gitweb /
documentation/python: attempt to reproduce a Py3.6-specific typing issue.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 09:17:50 +0000 (11:17 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 10:04:40 +0000 (12:04 +0200)
documentation/test_python/inspect_annotations/inspect_annotations.html
documentation/test_python/inspect_annotations/inspect_annotations.py

index 50603d27da3f986a5593f56097b86f099c0727f4..2b35cca110a93f20281409eb0262938995375861 100644 (file)
@@ -41,6 +41,8 @@
           <dl class="m-doc">
             <dt>class <a href="inspect_annotations.AContainer.html" class="m-doc">AContainer</a></dt>
             <dd>A generic class. No parent class info extracted yet.</dd>
+            <dt>class <a href="inspect_annotations.AContainer2.html" class="m-doc">AContainer2</a></dt>
+            <dd>Another class derived from a typing thing.</dd>
             <dt>class <a href="inspect_annotations.Foo.html" class="m-doc">Foo</a></dt>
             <dd>A class with properties</dd>
             <dt>class <a href="inspect_annotations.FooSlots.html" class="m-doc">FooSlots</a></dt>
index 7ef97fc948c09597ed9b7ad72c5728ca443b9819..b7e8218b7bacc3d443b2499bdce093cb51eb274c 100644 (file)
@@ -2,7 +2,7 @@
 
 import sys
 
-from typing import List, Tuple, Dict, Any, Union, Optional, Callable, TypeVar, Generic
+from typing import List, Tuple, Dict, Any, Union, Optional, Callable, TypeVar, Generic, Iterator
 
 class Foo:
     """A class with properties"""
@@ -21,9 +21,12 @@ class FooSlots:
 
 _T = TypeVar('Tp')
 
-# Triggers a corner case with _gorg on Py3.6
+# 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.
 class AContainer(Generic[_T]):
     """A generic class. No parent class info extracted yet."""
+class AContainer2(Iterator):
+    """Another class derived from a typing thing."""
 
 def annotation(param: List[int], another: bool, third: str = "hello") -> float:
     """An annotated function"""