Return the bool argument for the decorator. This handles both @decorator(...) and @decorator.
(ctx: ClassDefContext, name: str, default: bool)
| 53 | |
| 54 | |
| 55 | def _get_decorator_bool_argument(ctx: ClassDefContext, name: str, default: bool) -> bool: |
| 56 | """Return the bool argument for the decorator. |
| 57 | |
| 58 | This handles both @decorator(...) and @decorator. |
| 59 | """ |
| 60 | if isinstance(ctx.reason, CallExpr): |
| 61 | return _get_bool_argument(ctx, ctx.reason, name, default) |
| 62 | else: |
| 63 | return default |
| 64 | |
| 65 | |
| 66 | def _get_bool_argument(ctx: ClassDefContext, expr: CallExpr, name: str, default: bool) -> bool: |
no test coverage detected
searching dependent graphs…