mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-20 11:07:38 +03:00
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]:
|
||||
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({})
|
||||
|
@ -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:
|
||||
|
@ -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):
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user