We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67212a5 commit 43bbdb4Copy full SHA for 43bbdb4
fgpyo/util/metric.py
@@ -367,8 +367,8 @@ def is_attrs_instance(metric: Metric) -> TypeGuard[inspect.AttrsInstance]:
367
"""
368
Test if the given metric is an attr.s instance.
369
370
- NB: `attr.has` does not provide a type guard, which we need to use other `attr` methods such as
371
- `asdict()`, so we implement one here.
+ NB: `attr.has` provides a type guard, but only on the class object - we want to narrow the type
+ of the metric instance, so we implement a guard here.
372
373
Args:
374
metric: An instance of a Metric.
0 commit comments