(self)
| 58 | return self.bytes / _BYTES_PER_TB |
| 59 | |
| 60 | def __str__(self) -> str: |
| 61 | if self.bytes >= _BYTES_PER_TB: |
| 62 | return f'{self.to_tb():.2f} TB' |
| 63 | if self.bytes >= _BYTES_PER_GB: |
| 64 | return f'{self.to_gb():.2f} GB' |
| 65 | if self.bytes >= _BYTES_PER_MB: |
| 66 | return f'{self.to_mb():.2f} MB' |
| 67 | if self.bytes >= _BYTES_PER_KB: |
| 68 | return f'{self.to_kb():.2f} KB' |
| 69 | return f'{self.bytes} B' |
| 70 | |
| 71 | def __eq__(self, other: object) -> bool: |
| 72 | if isinstance(other, ByteSize): |