X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=histogram.py;h=ba10a015d951309d4a8411f081b5789c0585f253;hb=cd069f03be92562dd4046382c2e814fdaeb4bd8b;hp=993b5036d737cdcd705ef411e5cbcf70ba0da911;hpb=971d4ba141459f78d10d5770b9459d1ead7d49a0;p=python_utils.git diff --git a/histogram.py b/histogram.py index 993b503..ba10a01 100644 --- a/histogram.py +++ b/histogram.py @@ -85,8 +85,8 @@ class SimpleHistogram(Generic[T]): return txt max_label_width: Optional[int] = None - lowest_start: int = None - highest_end: int = None + lowest_start: Optional[int] = None + highest_end: Optional[int] = None for bucket in sorted(self.buckets, key=lambda x: x[0]): start = bucket[0] if lowest_start is None: @@ -100,9 +100,9 @@ class SimpleHistogram(Generic[T]): max_label_width = label_width if start == last_bucket_start: break - assert max_label_width - assert lowest_start - assert highest_end + assert max_label_width is not None + assert lowest_start is not None + assert highest_end is not None sigma_label = f'[{label_formatter}..{label_formatter}): ' % ( lowest_start,