Another mypy update another round of spurious errors

This commit is contained in:
Kovid Goyal 2022-11-08 17:12:49 +05:30
parent 72f92b395f
commit 2e8ef66496
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 9 additions and 9 deletions

View File

@ -192,7 +192,7 @@ def safe_increment_bias(old_val: float, increment: float) -> float:
def normalize_biases(biases: List[float]) -> List[float]:
s = sum(biases)
if s == 1:
if s == 1.0:
return biases
return [x/s for x in biases]
@ -212,7 +212,7 @@ def distribute_indexed_bias(base_bias: Sequence[float], index_bias_map: Dict[int
class Layout:
name: Optional[str] = None
name: str = ''
needs_window_borders = True
must_draw_borders = False # can be overridden to customize behavior from kittens
layout_opts = LayoutOpts({})

View File

@ -36,7 +36,7 @@ def calc_grid_size(n: int) -> Tuple[int, int, int, int]:
class Grid(Layout):
name = 'grid'
name: str = 'grid'
no_minimal_window_borders = True
def remove_all_biases(self) -> bool:

View File

@ -47,10 +47,10 @@ def search(self, universal_set: Set[T], get_matches: GetMatches[T]) -> Set[T]:
return self(universal_set, get_matches)
def __call__(self, candidates: Set[T], get_matches: GetMatches[T]) -> Set[T]:
...
return set()
def iter_token_nodes(self) -> Iterator['TokenNode']:
...
return iter(())
class OrNode(SearchTreeNode):

View File

@ -506,17 +506,17 @@ def parse_address_spec(spec: str) -> Tuple[AddressFamily, Union[Tuple[str, int],
def write_all(fd: int, data: Union[str, bytes], block_until_written: bool = True) -> None:
if isinstance(data, str):
data = data.encode('utf-8')
data = memoryview(data)
while data:
mvd = memoryview(data)
while len(mvd) > 0:
try:
n = os.write(fd, data)
n = os.write(fd, mvd)
except BlockingIOError:
if not block_until_written:
raise
continue
if not n:
break
data = data[n:]
mvd = mvd[n:]
class TTYIO: