diff --git a/prometheus_client/metrics.py b/prometheus_client/metrics.py index 12f793c2..7e06d992 100644 --- a/prometheus_client/metrics.py +++ b/prometheus_client/metrics.py @@ -107,7 +107,7 @@ def __init__(self: T, namespace: str = '', subsystem: str = '', unit: str = '', - registry: CollectorRegistry = REGISTRY, + registry: Optional[CollectorRegistry] = REGISTRY, _labelvalues: Optional[Sequence[str]] = None, ) -> None: self._name = _build_full_name(self._type, name, namespace, subsystem, unit) @@ -677,7 +677,7 @@ def __init__(self, namespace: str = '', subsystem: str = '', unit: str = '', - registry: CollectorRegistry = REGISTRY, + registry: Optional[CollectorRegistry] = REGISTRY, _labelvalues: Optional[Sequence[str]] = None, states: Optional[Sequence[str]] = None, ):