(cls, cb: typing.Callable[..., None])
| 2625 | |
| 2626 | @classmethod |
| 2627 | def from_callable(cls, cb: typing.Callable[..., None]) -> '_Callback': |
| 2628 | if inspect.iscoroutinefunction(cb): |
| 2629 | is_async = True |
| 2630 | elif callable(cb): |
| 2631 | is_async = False |
| 2632 | else: |
| 2633 | raise exceptions.InterfaceError( |
| 2634 | 'expected a callable or an `async def` function,' |
| 2635 | 'got {!r}'.format(cb) |
| 2636 | ) |
| 2637 | |
| 2638 | return cls(cb, is_async) |
| 2639 | |
| 2640 | |
| 2641 | class _Atomic: |
no outgoing calls
no test coverage detected