-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This AverageIndent swallows exception when its lines empty:
Lines 28 to 41 in 091c121
| class AverageIndent: | |
| """Average indent of lines block.""" | |
| def __init__(self, origin: Lines): | |
| self.origin = origin | |
| def value(self) -> float: | |
| """Average indent itself.""" | |
| indents = map(Indent, self.origin) | |
| try: | |
| return mean(indent.length() for indent in indents) | |
| except StatisticsError: | |
| # if origin has no lines | |
| return 0.0 |
This is why we can't either filter out empty indents or do zero by ourselves.
Goals:
- Move exception handling to another class
Metadata
Metadata
Assignees
Labels
No labels