| Conditions | 2 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | |||
| 15 | def _set_ordering(*, setter, cls: type, source: type): |
||
| 16 | collision = setter( |
||
| 17 | cls, source.__lt__, source.__le__, source.__gt__, source.__ge__ # type: ignore |
||
| 18 | ) |
||
| 19 | if collision: |
||
| 20 | raise TypeError( |
||
| 21 | "Cannot overwrite attribute {collision} in class " |
||
| 22 | "{name}. Consider using functools.total_ordering".format( |
||
| 23 | collision=collision, name=cls.__name__ |
||
| 24 | ) |
||
| 26 |