2
2
import time
3
3
import types
4
4
from typing import (
5
- Any , Callable , Dict , Iterable , Optional , Sequence , Type , TypeVar ,
5
+ Any , Callable , Dict , Iterable , Optional , Sequence , Type , TypeVar , Union ,
6
6
)
7
7
8
8
from . import values # retain this import style for testability
@@ -538,7 +538,7 @@ def __init__(self,
538
538
unit : str = '' ,
539
539
registry : Optional [CollectorRegistry ] = REGISTRY ,
540
540
_labelvalues : Optional [Sequence [str ]] = None ,
541
- buckets : Sequence [float ] = DEFAULT_BUCKETS ,
541
+ buckets : Sequence [Union [ float , int , str ] ] = DEFAULT_BUCKETS ,
542
542
):
543
543
self ._prepare_buckets (buckets )
544
544
super ().__init__ (
@@ -553,7 +553,7 @@ def __init__(self,
553
553
)
554
554
self ._kwargs ['buckets' ] = buckets
555
555
556
- def _prepare_buckets (self , buckets : Sequence [float ]) -> None :
556
+ def _prepare_buckets (self , buckets : Sequence [Union [ float , int , str ] ]) -> None :
557
557
buckets = [float (b ) for b in buckets ]
558
558
if buckets != sorted (buckets ):
559
559
# This is probably an error on the part of the user,
0 commit comments