Return @classmethod or @staticmethod, if any, for the given callable type.
(tp: CallableType)
| 3029 | |
| 3030 | |
| 3031 | def pretty_class_or_static_decorator(tp: CallableType) -> str | None: |
| 3032 | """Return @classmethod or @staticmethod, if any, for the given callable type.""" |
| 3033 | definition = get_func_def(tp) |
| 3034 | if definition is not None and isinstance(definition, SYMBOL_FUNCBASE_TYPES): |
| 3035 | if definition.is_class: |
| 3036 | return "@classmethod" |
| 3037 | if definition.is_static: |
| 3038 | return "@staticmethod" |
| 3039 | return None |
| 3040 | |
| 3041 | |
| 3042 | def pretty_callable(tp: CallableType, options: Options, skip_self: bool = False) -> str: |
no test coverage detected
searching dependent graphs…