Is this a dangerous target (right argument) for an isinstance() check?
(typ: ProperType)
| 130 | |
| 131 | |
| 132 | def is_dangerous_target(typ: ProperType) -> bool: |
| 133 | """Is this a dangerous target (right argument) for an isinstance() check?""" |
| 134 | if isinstance(typ, TupleType): |
| 135 | return any(is_dangerous_target(get_proper_type(t)) for t in typ.items) |
| 136 | if isinstance(typ, FunctionLike) and typ.is_type_obj(): |
| 137 | return typ.type_object().has_base("mypy.types.Type") |
| 138 | return False |
| 139 | |
| 140 | |
| 141 | def proper_type_hook(ctx: FunctionContext) -> Type: |
no test coverage detected
searching dependent graphs…