From: Vladimír Vondruš Date: Mon, 11 May 2020 09:17:50 +0000 (+0200) Subject: documentation/python: attempt to reproduce a Py3.6-specific typing issue. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=46f35b8053abe52e8327ca841e7d2bfbac7b73e5;p=blog.git documentation/python: attempt to reproduce a Py3.6-specific typing issue. --- diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.html b/documentation/test_python/inspect_annotations/inspect_annotations.html index 50603d27..2b35cca1 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.html +++ b/documentation/test_python/inspect_annotations/inspect_annotations.html @@ -41,6 +41,8 @@
class AContainer
A generic class. No parent class info extracted yet.
+
class AContainer2
+
Another class derived from a typing thing.
class Foo
A class with properties
class FooSlots
diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.py b/documentation/test_python/inspect_annotations/inspect_annotations.py index 7ef97fc9..b7e8218b 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.py +++ b/documentation/test_python/inspect_annotations/inspect_annotations.py @@ -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"""