(self, data)
| 79 | |
| 80 | class UID: |
| 81 | def __init__(self, data): |
| 82 | if not isinstance(data, int): |
| 83 | raise TypeError("data must be an int") |
| 84 | if data >= 1 << 64: |
| 85 | raise ValueError("UIDs cannot be >= 2**64") |
| 86 | if data < 0: |
| 87 | raise ValueError("UIDs must be positive") |
| 88 | self.data = data |
| 89 | |
| 90 | def __index__(self): |
| 91 | return self.data |