# HG changeset patch # User Tassilo Philipp # Date 1605287045 -3600 # Node ID 44045db8fa5fc4374ed27e3cb16c409626c40f6f # Parent c21d1c2c84e11cbcc81fd749d69acc80b746f9ba PyCObject/PyCapsule not usable as type annotation diff -r c21d1c2c84e1 -r 44045db8fa5f python/pydc/pydc-stubs/pydc.pyi --- 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: ...