(cls, cb: typing.Callable[..., None])
| 2680 | |
| 2681 | @classmethod |
| 2682 | def from_callable(cls, cb: typing.Callable[..., None]) -> '_Callback': |
| 2683 | if inspect.iscoroutinefunction(cb): |
| 2684 | is_async = True |
| 2685 | elif callable(cb): |
| 2686 | is_async = False |
| 2687 | else: |
| 2688 | raise exceptions.InterfaceError( |
| 2689 | 'expected a callable or an `async def` function,' |
| 2690 | 'got {!r}'.format(cb) |
| 2691 | ) |
| 2692 | |
| 2693 | return cls(cb, is_async) |
| 2694 | |
| 2695 | |
| 2696 | class _Atomic: |
no outgoing calls
no test coverage detected