Skip to content

Commit de51add

Browse files
authored
fix(type): use Generator over Iterator
1 parent 3e84be4 commit de51add

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: aws_lambda_powertools/metrics/metric.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import logging
33
from contextlib import contextmanager
4-
from typing import Dict, Iterator, Optional, Union
4+
from typing import Dict, Optional, Union, Generator
55

66
from .base import MetricManager, MetricUnit
77

@@ -61,7 +61,7 @@ def add_metric(self, name: str, unit: Union[MetricUnit, str], value: float) -> N
6161

6262

6363
@contextmanager
64-
def single_metric(name: str, unit: MetricUnit, value: float, namespace: Optional[str] = None) -> Iterator[SingleMetric]:
64+
def single_metric(name: str, unit: MetricUnit, value: float, namespace: Optional[str] = None) -> Generator[SingleMetric, None, None]:
6565
"""Context manager to simplify creation of a single metric
6666
6767
Example

0 commit comments

Comments
 (0)