changeset 47:44045db8fa5f

PyCObject/PyCapsule not usable as type annotation
author Tassilo Philipp
date Fri, 13 Nov 2020 18:04:05 +0100
parents c21d1c2c84e1
children a2125195b052
files python/pydc/pydc-stubs/pydc.pyi
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/python/pydc/pydc-stubs/pydc.pyi	Fri Nov 13 14:10:31 2020 +0100
+++ b/python/pydc/pydc-stubs/pydc.pyi	Fri Nov 13 18:04:05 2020 +0100
@@ -1,11 +1,9 @@
 import sys
 from typing import Optional, Any, TypeVar
 
-# Handle type is different, depending on python version
-if sys.version_info < (2, 7) or (sys.version_info >= (3, 0) and sys.version_info < (3, 1)):
-    H = TypeVar('H', PyCObject)
-else:
-    H = TypeVar('H', PyCapsule)
+# Handle type, depending on python version this is either internal type
+# PyCObject or PyCapsule, neither of one can be used as annotation
+H = TypeVar('H')
 
 def load(libpath: Optional[str]) -> H: ...
 def find(libhandle: H, symbol: str) -> H: ...