@@ -113,7 +113,11 @@ def loop_getter_need_context(self) -> bool:
113113 return self .__loop_getter_need_context
114114
115115 def _get_loop (self , * args : typing .Any , ** kwargs : typing .Any ) -> typing .Optional [asyncio .AbstractEventLoop ]:
116- """Get event loop in decorator class."""
116+ """Get event loop in decorator class.
117+
118+ :return: event loop if available or getter available
119+ :rtype: Optional[asyncio.AbstractEventLoop]
120+ """
117121 if callable (self .loop_getter ):
118122 if self .loop_getter_need_context :
119123 return self .loop_getter (* args , ** kwargs ) # pylint: disable=not-callable
@@ -128,19 +132,20 @@ def _get_function_wrapper(
128132 :param func: Wrapped function
129133 :type func: typing.Callable
130134 :return: wrapped coroutine or function
131- :rtype: typing. Callable[..., typing. Union[typing. Awaitable, concurrent.futures.Future]]
135+ :rtype: Callable[..., Union[Awaitable, concurrent.futures.Future]]
132136 """
133137 prepared = self ._await_if_required (func )
134138
135139 # noinspection PyMissingOrEmptyDocstring
136140 @functools .wraps (prepared )
137141 def wrapper (
138142 * args : typing .Any , ** kwargs : typing .Any
139- ) -> typing .Union [
140- "concurrent.futures.Future[typing.Any]" ,
141- "typing.Awaitable[typing.Any]" ,
142- typing .Callable [..., "typing.Union[concurrent.futures.Future[typing.Any], typing.Awaitable[typing.Any]]" ],
143- ]:
143+ ) -> typing .Union ["concurrent.futures.Future[typing.Any]" , "typing.Awaitable[typing.Any]" ,]:
144+ """Main function wrapper.
145+
146+ :return: coroutine or function
147+ :rtype: Union[Awaitable, concurrent.futures.Future]
148+ """
144149 loop : typing .Optional [asyncio .AbstractEventLoop ] = self ._get_loop (* args , ** kwargs )
145150
146151 if loop is None :
@@ -159,11 +164,19 @@ def __call__( # pylint: disable=useless-super-delegation
159164 "typing.Awaitable[typing.Any]" ,
160165 typing .Callable [..., "typing.Union[concurrent.futures.Future[typing.Any], typing.Awaitable[typing.Any]]" ],
161166 ]:
162- """Callable instance."""
167+ """Callable instance.
168+
169+ :return: Future, Awaitable or it's getter (depends of decoration way and asyncio.Loop provided)
170+ :rtype: Union[concurrent.futures.Future[Any], Awaitable[Any] Callable[..., ...]]
171+ """
163172 return super ().__call__ (* args , ** kwargs ) # type: ignore
164173
165174 def __repr__ (self ) -> str : # pragma: no cover
166- """For debug purposes."""
175+ """For debug purposes.
176+
177+ :return: repr info
178+ :rtype: str
179+ """
167180 return (
168181 f"<{ self .__class__ .__name__ } ("
169182 f"{ self ._func !r} , "
0 commit comments