Skip to content

Commit

Permalink
Some fixes for static type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Aug 27, 2024
1 parent 677aefd commit 98d19bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion notebooks/Repairer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@
" self.mutations += 1\n",
"\n",
" if self.log:\n",
" print(f\"{node.lineno:4}:{op.__name__ + ':':7} \"\n",
" print(f\"{node.lineno:4}:{op.__name__ + ':':7} \" # type: ignore\n",
" f\"{self.format_node(node)} \"\n",
" f\"becomes {self.format_node(new_node)}\")\n",
"\n",
Expand Down
16 changes: 8 additions & 8 deletions notebooks/Slicer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,7 @@
"def make_get_data(id: str, method: str = 'get') -> Call:\n",
" return Call(func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()), \n",
" attr=method, ctx=Load()),\n",
" args=[ast.Str(s=id), Name(id=id, ctx=Load())],\n",
" args=[ast.Str(id), Name(id=id, ctx=Load())],\n",
" keywords=[])"
]
},
Expand All @@ -2134,7 +2134,7 @@
"metadata": {},
"outputs": [],
"source": [
"show_ast(Module(body=[make_get_data(\"x\")]))"
"show_ast(Module(body=[make_get_data(\"x\")], type_ignores=[]))"
]
},
{
Expand Down Expand Up @@ -2410,7 +2410,7 @@
"\n",
" new_node = Call(func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()),\n",
" attr=method, ctx=Load()),\n",
" args=[ast.Str(s=id), value],\n",
" args=[ast.Str(id), value],\n",
" keywords=keywords)\n",
"\n",
" ast.copy_location(new_node, value)\n",
Expand Down Expand Up @@ -3435,11 +3435,11 @@
"\n",
" create_stmts = []\n",
" for n, child in enumerate(named_args):\n",
" keywords=[keyword(arg='pos', value=ast.Num(n=n + 1))]\n",
" keywords=[keyword(arg='pos', value=ast.Num(n + 1))]\n",
" if child is node.args.vararg:\n",
" keywords.append(keyword(arg='vararg', value=ast.Str(s='*')))\n",
" keywords.append(keyword(arg='vararg', value=ast.Str('*')))\n",
" if child is node.args.kwarg:\n",
" keywords.append(keyword(arg='vararg', value=ast.Str(s='**')))\n",
" keywords.append(keyword(arg='vararg', value=ast.Str('**')))\n",
" if n == len(named_args) - 1:\n",
" keywords.append(keyword(arg='last',\n",
" value=ast.NameConstant(value=True)))\n",
Expand All @@ -3448,7 +3448,7 @@
" value=Call(\n",
" func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()),\n",
" attr='param', ctx=Load()),\n",
" args=[ast.Str(s=child.arg),\n",
" args=[ast.Str(child.arg),\n",
" Name(id=child.arg, ctx=Load())\n",
" ],\n",
" keywords=keywords\n",
Expand Down Expand Up @@ -6524,7 +6524,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.10 (main, Jan 15 2022, 11:48:04) \n[Clang 13.0.0 (clang-1300.0.29.3)]"
"version": "3.10.2"
},
"toc": {
"base_numbering": 1,
Expand Down

0 comments on commit 98d19bf

Please sign in to comment.