(duck_type, context: EvaluationContext)
| 1464 | |
| 1465 | |
| 1466 | def _eval_or_create_duck(duck_type, context: EvaluationContext): |
| 1467 | policy = get_policy(context) |
| 1468 | # if allow-listed builtin is on type annotation, instantiate it |
| 1469 | if policy.can_call(duck_type): |
| 1470 | return duck_type() |
| 1471 | # if custom class is in type annotation, mock it |
| 1472 | return _create_duck_for_heap_type(duck_type) |
| 1473 | |
| 1474 | |
| 1475 | def _create_duck_for_heap_type(duck_type): |
no test coverage detected
searching dependent graphs…