You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* origin/pr/458:
misc. typing fixes
type-hint storage.py
type-hint spinner.py
type-hint log.py
type-hint label.py
Pull request description:
Major: type-hint `storage.py`
Minor: type-hint `label.py spinner.py log.py`
In `__lt__` we have
```python3
if self._vid and other._vid:
return (self._pool, self._vid) < (other._pool, other._vid)
```
Technically, `_vid` is supposed to be non-None if `pool` is non-None, not the other way around. Shouldn't it be `if self.pool and other.pool:` ?
In `revert`:
```python3
if not isinstance(revision, str):
raise TypeError('revision must be a str')
```
but typing `def revert(self, revision: str) -> None:` raises no type-checker error, indicating that it's never called with a non-str argument. Is the raise really necessary ?
```python3
def __str__(self):
return self.name
```
but `self.name` can be `None`, and `__str__` should never be `None`. I added an `assert is not None` for now.
```python3
def __lt__(self, other: object) -> bool:
if isinstance(other, Pool):
return self.name < other.name
```
What guarantees that `self.name` or `other.name` is defined here ?
0 commit comments