1818import six
1919
2020try : # pragma: no cover
21- import typing
22- TargetFunctionType = typing .Optional [typing .Callable [..., typing .Any ]]
21+ import typing # pylint: disable=unused-import
2322except ImportError : # pragma: no cover
23+ # noinspection PyRedeclaration
2424 typing = None
25- TargetFunctionType = None
2625
2726__all__ = (
2827 'SeparateClassMethod' ,
@@ -104,8 +103,8 @@ class SeparateClassMethod(object):
104103
105104 def __init__ (
106105 self ,
107- imeth = None , # type: TargetFunctionType
108- cmeth = None , # type: TargetFunctionType
106+ imeth = None , # type: typing.Optional[typing.Callable]
107+ cmeth = None , # type: typing.Optional[typing.Callable]
109108 ):
110109 """Separate class method and instance methods.
111110
@@ -117,7 +116,11 @@ def __init__(
117116 self .__instance_method = imeth
118117 self .__class_method = cmeth
119118
120- def __get__ (self , instance , owner ): # type: (...) -> TargetFunctionType
119+ def __get__ (
120+ self ,
121+ instance , # type: owner
122+ owner # type: type
123+ ): # type: (...) -> typing.Callable
121124 """Get descriptor.
122125
123126 :rtype: typing.Callable[..., typing.Any]
@@ -143,7 +146,7 @@ def instance_method(*args, **kwargs):
143146
144147 def instance_method (
145148 self ,
146- imeth # type: TargetFunctionType
149+ imeth # type: typing.Optional[typing.Callable]
147150 ): # type: (...) -> SeparateClassMethod
148151 """Descriptor to change instance method.
149152
@@ -156,7 +159,7 @@ def instance_method(
156159
157160 def class_method (
158161 self ,
159- cmeth # type: TargetFunctionType
162+ cmeth # type: typing.Optional[typing.Callable]
160163 ): # type: (...) -> SeparateClassMethod
161164 """Descriptor to change class method.
162165
@@ -168,15 +171,15 @@ def class_method(
168171 return self
169172
170173 @property
171- def imeth (self ): # type: (SeparateClassMethod ) -> TargetFunctionType
174+ def imeth (self ): # type: () -> typing.Optional[typing.Callable]
172175 """Instance method instance.
173176
174177 :rtype: typing.Optional[typing.Callable[..., typing.Any]]
175178 """
176179 return self .__instance_method
177180
178181 @property
179- def cmeth (self ): # type: (SeparateClassMethod ) -> TargetFunctionType
182+ def cmeth (self ): # type: () -> typing.Optional[typing.Callable]
180183 """Class method instance.
181184
182185 :rtype: typing.Optional[typing.Callable[..., typing.Any]]
0 commit comments