Another mypy update another round of spurious errors
This commit is contained in:
parent
72f92b395f
commit
2e8ef66496
@ -192,7 +192,7 @@ def safe_increment_bias(old_val: float, increment: float) -> float:
|
|||||||
|
|
||||||
def normalize_biases(biases: List[float]) -> List[float]:
|
def normalize_biases(biases: List[float]) -> List[float]:
|
||||||
s = sum(biases)
|
s = sum(biases)
|
||||||
if s == 1:
|
if s == 1.0:
|
||||||
return biases
|
return biases
|
||||||
return [x/s for x in 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:
|
class Layout:
|
||||||
|
|
||||||
name: Optional[str] = None
|
name: str = ''
|
||||||
needs_window_borders = True
|
needs_window_borders = True
|
||||||
must_draw_borders = False # can be overridden to customize behavior from kittens
|
must_draw_borders = False # can be overridden to customize behavior from kittens
|
||||||
layout_opts = LayoutOpts({})
|
layout_opts = LayoutOpts({})
|
||||||
|
|||||||
@ -36,7 +36,7 @@ def calc_grid_size(n: int) -> Tuple[int, int, int, int]:
|
|||||||
|
|
||||||
class Grid(Layout):
|
class Grid(Layout):
|
||||||
|
|
||||||
name = 'grid'
|
name: str = 'grid'
|
||||||
no_minimal_window_borders = True
|
no_minimal_window_borders = True
|
||||||
|
|
||||||
def remove_all_biases(self) -> bool:
|
def remove_all_biases(self) -> bool:
|
||||||
|
|||||||
@ -47,10 +47,10 @@ class SearchTreeNode:
|
|||||||
return self(universal_set, get_matches)
|
return self(universal_set, get_matches)
|
||||||
|
|
||||||
def __call__(self, candidates: Set[T], get_matches: GetMatches[T]) -> Set[T]:
|
def __call__(self, candidates: Set[T], get_matches: GetMatches[T]) -> Set[T]:
|
||||||
...
|
return set()
|
||||||
|
|
||||||
def iter_token_nodes(self) -> Iterator['TokenNode']:
|
def iter_token_nodes(self) -> Iterator['TokenNode']:
|
||||||
...
|
return iter(())
|
||||||
|
|
||||||
|
|
||||||
class OrNode(SearchTreeNode):
|
class OrNode(SearchTreeNode):
|
||||||
|
|||||||
@ -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:
|
def write_all(fd: int, data: Union[str, bytes], block_until_written: bool = True) -> None:
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
data = data.encode('utf-8')
|
data = data.encode('utf-8')
|
||||||
data = memoryview(data)
|
mvd = memoryview(data)
|
||||||
while data:
|
while len(mvd) > 0:
|
||||||
try:
|
try:
|
||||||
n = os.write(fd, data)
|
n = os.write(fd, mvd)
|
||||||
except BlockingIOError:
|
except BlockingIOError:
|
||||||
if not block_until_written:
|
if not block_until_written:
|
||||||
raise
|
raise
|
||||||
continue
|
continue
|
||||||
if not n:
|
if not n:
|
||||||
break
|
break
|
||||||
data = data[n:]
|
mvd = mvd[n:]
|
||||||
|
|
||||||
|
|
||||||
class TTYIO:
|
class TTYIO:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user