Skip to content

Commit 18b0804

Browse files
maggiemossmeta-codesync[bot]
authored andcommitted
Remove unused type error suppressions - cinderx
Summary: This diff was automatically generated by the Pyre per-target upgrade tool. It removes `# pyre-fixme` or `pyrefly: ignore` comments that are no longer needed because the underlying type errors have been resolved. Note that it will also aim to ensure type checking runs cleanly, and will add suppressions to existing type errors. #pyreupgrade Reviewed By: yoney Differential Revision: D116323652 fbshipit-source-id: 16775a8bc83c1ef848623099f1596611af30e8a6
1 parent 13efe1b commit 18b0804

71 files changed

Lines changed: 22 additions & 383 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cinderx/PythonLib/cinderx/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ async def _async_compute(self) -> _T:
250250

251251
self.state = _AsyncLazyValueState.Done
252252

253-
# pyre-fixme[1001]: Awaitable assigned to `value` is never awaited.
254253
for value in futures:
255254
if not value.done():
256255
value.set_result(self.res)
@@ -263,7 +262,6 @@ async def _async_compute(self) -> _T:
263262
return res
264263

265264
except (Exception, asyncio.CancelledError) as e:
266-
# pyre-fixme[1001]: Awaitable assigned to `value` is never awaited.
267265
for value in futures:
268266
if not value.done():
269267
value.set_exception(e)

cinderx/PythonLib/cinderx/_asyncio.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ async def _async_compute(self) -> _T:
8888

8989
self.state = _AsyncLazyValueState.Done
9090

91-
# pyre-ignore[1001]: Pyre is worried about how we're accessing futures
9291
# without awaiting them.
9392
for value in futures:
9493
if not value.done():
@@ -102,7 +101,6 @@ async def _async_compute(self) -> _T:
102101
return res
103102

104103
except (Exception, CancelledError) as e:
105-
# pyre-ignore[1001]: Pyre is worried about how we're accessing futures
106104
# without awaiting them.
107105
for value in futures:
108106
if not value.done():

cinderx/PythonLib/cinderx/compiler/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ def get_disassembly_as_string(co: object, recurse: bool = False) -> str:
4747
dis.dis(co, file=s)
4848
return s.getvalue()
4949

50-
# pyre-fixme[21]: Could not find name `Formatter` in `dis` (stubbed).
51-
# pyre-fixme[21]: Could not find name `_get_code_object` in `dis` (stubbed).
5250
from dis import _get_code_object, Bytecode, Formatter
5351

5452
formatter = Formatter(file=s, offset_width=3)

cinderx/PythonLib/cinderx/compiler/dis_stable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def _disassemble_bytes(
7474
# Omit the line number column entirely if we have no line number info
7575
show_lineno = linestarts is not None
7676
if show_lineno:
77-
# pyre-fixme [16]: `Optional` has no attribute `values`.
7877
maxlineno = max(linestarts.values()) + line_offset
7978
if maxlineno >= 1000:
8079
lineno_width = len(str(maxlineno))

cinderx/PythonLib/cinderx/compiler/flow_graph_optimizer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ def opt_return_value(
360360
) -> int | None:
361361
block.insts = block.insts[: instr_index + 1]
362362

363-
# pyrefly: ignore [bad-assignment]
364363
handlers: dict[str, Handler] = {
365364
# pyrefly: ignore [bad-assignment]
366365
"JUMP_IF_FALSE_OR_POP": opt_jump_if_false_or_pop,
@@ -1097,7 +1096,6 @@ def optimize_call_intrinsic_1(
10971096
block: Block,
10981097
) -> int | None:
10991098
assert isinstance(self, FlowGraphOptimizer314)
1100-
# pyre-fixme[16]: Module `opcodes` has no attribute `INTRINSIC_1`.
11011099
intrins = INTRINSIC_1[instr.ioparg]
11021100
if intrins == "INTRINSIC_LIST_TO_TUPLE":
11031101
if next_instr is not None and next_instr.opname == "GET_ITER":

cinderx/PythonLib/cinderx/compiler/opcodes.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@
5050
hasjabs,
5151
STATIC_CONST_OPCODES if sys.version_info >= (3, 14) else hasconst,
5252
hasarg,
53-
# pyre-fixme[16]: Module `opcode` has no attribute `_cache_format`.
5453
_cache_format,
55-
# pyre-fixme[16]: Module `opcode` has no attribute `_specializations`.
5654
_specializations,
57-
# pyre-fixme[16]: Module `opcode` has no attribute `_inline_cache_entries`.
5855
_inline_cache_entries,
5956
)
6057
if sys.version_info >= (3, 14):
@@ -254,9 +251,6 @@
254251
)
255252

256253
if sys.version_info >= (3, 12):
257-
# pyre-fixme[21]: Could not find name `_intrinsic_1_descs` in `opcode` (stubbed).
258-
# pyre-fixme[21]: Could not find name `_intrinsic_2_descs` in `opcode` (stubbed).
259-
# pyre-fixme[21]: Could not find name `_nb_ops` in `opcode` (stubbed).
260254
from opcode import (
261255
# pyrefly: ignore [missing-module-attribute]
262256
_intrinsic_1_descs as INTRINSIC_1,
@@ -972,7 +966,6 @@ def _load_mapping_arg_effect(oparg: int, _jmp: int = 0) -> int:
972966

973967

974968
def find_op_idx(opname: str) -> int:
975-
# pyre-fixme[16]: Module `opcode` has no attribute `_nb_ops`.
976969
for i, (name, _symbol) in enumerate(NB_OPS):
977970
if name == opname:
978971
return i

cinderx/PythonLib/cinderx/compiler/optimizer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class PyLimits:
3333
ast.NotIn: ast.In,
3434
}
3535

36-
# pyrefly: ignore [bad-assignment]
3736
BIN_OPS: Mapping[type[ast.operator], Callable[[object, object], object]] = {
3837
# pyrefly: ignore [bad-assignment]
3938
ast.Add: operator.add,
@@ -240,7 +239,7 @@ def _visitIter(self, node: ast.expr) -> ast.expr:
240239
# pyre-ignore[6]: Can't type walk_list fully yet.
241240
res = self.makeConstTuple(elts)
242241
if res is not None:
243-
# pyrefly: ignore [bad-argument-type, no-matching-overload]
242+
# pyrefly: ignore [bad-argument-type]
244243
return copy_location(Constant(frozenset(res.value)), node)
245244

246245
return self.update_node(node, elts=elts)
@@ -534,9 +533,7 @@ def fold_const_match_patterns(self, node: ast.expr) -> ast.expr:
534533
node = self.update_node(
535534
node, left=self.fold_const_match_patterns(node.left)
536535
)
537-
# pyrefly: ignore [missing-attribute]
538536
if isinstance(node.left, ast.Constant):
539-
# pyrefly: ignore [bad-argument-type]
540537
return super().visitBinOp(node)
541538

542539
return node

cinderx/PythonLib/cinderx/compiler/pyassem.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,6 @@ def _convert_DEREF(self, arg: object) -> int:
10101010
return self.closure.get_index(arg)
10111011

10121012
# similarly for other opcodes...
1013-
# pyrefly: ignore [bad-assignment]
10141013
_converters: dict[str, Callable[[PyFlowGraph, object], int]] = {
10151014
# pyrefly: ignore [bad-assignment]
10161015
"LOAD_CLASS": _convert_LOAD_CONST,
@@ -1289,11 +1288,9 @@ def duplicate_exits_without_lineno(self) -> None:
12891288
target.num_predecessors -= 1
12901289
new_target.num_predecessors = 1
12911290
target.insert_next(new_target)
1292-
# pyrefly: ignore [missing-attribute]
12931291
append_after.setdefault(target, []).append(new_target)
12941292
for after, to_append in append_after.items():
12951293
idx = self.ordered_blocks.index(after) + 1
1296-
# pyrefly: ignore [no-matching-overload]
12971294
self.ordered_blocks[idx:idx] = reversed(to_append)
12981295

12991296
for block in self.ordered_blocks:
@@ -2516,7 +2513,7 @@ def _convert_compare_op(self: PyFlowGraph, arg: object) -> int:
25162513
_converters: dict[str, Callable[[PyFlowGraph, object], int]] = {
25172514
**PyFlowGraph312._converters,
25182515
"LOAD_COMMON_CONSTANT": lambda self, val: PyFlowGraph314._constant_idx[val],
2519-
# pyrefly: ignore [bad-index, bad-typed-dict-key]
2516+
# pyrefly: ignore [bad-index]
25202517
"LOAD_SPECIAL": lambda self, val: PyFlowGraph314._load_special_idx[val],
25212518
"COMPARE_OP": _convert_compare_op,
25222519
}

cinderx/PythonLib/cinderx/compiler/pycodegen.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,11 +3248,9 @@ def visitSubscript(self, node: ast.Subscript, aug_flag: bool = False) -> None:
32483248
assert 0
32493249

32503250
def emit_call_intrinsic_1(self, oparg: str) -> None:
3251-
# pyre-fixme[16]: Module `opcodes` has no attribute `INTRINSIC_1`.
32523251
self.emit("CALL_INTRINSIC_1", INTRINSIC_1.index(oparg))
32533252

32543253
def emit_call_intrinsic_2(self, oparg: str) -> None:
3255-
# pyre-fixme[16]: Module `opcodes` has no attribute `INTRINSIC_2`.
32563254
self.emit("CALL_INTRINSIC_2", INTRINSIC_2.index(oparg))
32573255

32583256
def emit_import_star(self) -> None:
@@ -6464,7 +6462,6 @@ def visitImportFrom(self, node: ast.ImportFrom) -> None:
64646462
name = alias.name
64656463
asname = alias.asname
64666464
if name == "*":
6467-
# pyre-fixme[16] This field does not appear to be used.
64686465
self.namespace = 0
64696466
self.emit_import_star()
64706467
# There can only be one name w/ from ... import *

cinderx/PythonLib/cinderx/compiler/pysourceloader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from .pycodegen import compile_code
2121

2222

23-
# pyre-fixme[13]: path inherited but not initialized
2423
class PySourceFileLoader(SourceFileLoader):
2524
# pyrefly: ignore [bad-override]
2625
def source_to_code(

0 commit comments

Comments
 (0)