Home
last modified time | relevance | path

Searched refs:type_comment (Results 1 – 8 of 8) sorted by relevance

/third_party/python/Lib/test/
Dtest_type_comments.py249 self.assertEqual(tree.body[0].type_comment, "() -> int")
250 self.assertEqual(tree.body[1].type_comment, "() -> None")
252 self.assertEqual(tree.body[0].type_comment, None)
253 self.assertEqual(tree.body[1].type_comment, None)
257 self.assertEqual(tree.body[0].type_comment, "() -> int")
258 self.assertEqual(tree.body[1].type_comment, "() -> int")
260 self.assertEqual(tree.body[0].type_comment, None)
261 self.assertEqual(tree.body[1].type_comment, None)
290 self.assertEqual(tree.body[0].type_comment, "() -> àçčéñt")
294 self.assertEqual(tree.body[0].type_comment, "int")
[all …]
/third_party/python/Parser/
DPython.asdl13 string? type_comment)
16 string? type_comment)
26 | Assign(expr* targets, expr value, string? type_comment)
32 | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
33 | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
36 | With(withitem* items, stmt* body, string? type_comment)
37 | AsyncWith(withitem* items, stmt* body, string? type_comment)
114 arg = (identifier arg, expr? annotation, string? type_comment)
Dpegen.c2249 function_def->v.FunctionDef.type_comment, function_def->lineno, in _PyPegen_function_def_decorators()
2258 function_def->v.FunctionDef.type_comment, function_def->lineno, in _PyPegen_function_def_decorators()
/third_party/python/Include/internal/
Dpycore_ast.h194 string type_comment; member
203 string type_comment; member
225 string type_comment; member
246 string type_comment; member
254 string type_comment; member
272 string type_comment; member
278 string type_comment; member
526 string type_comment; member
636 returns, string type_comment, int lineno, int
642 type_comment, int lineno, int col_offset, int
[all …]
Dpycore_ast_state.h240 PyObject *type_comment; member
/third_party/python/Python/
DPython-ast.c254 Py_CLEAR(state->type_comment); in _PyAST_Fini()
351 if ((state->type_comment = PyUnicode_InternFromString("type_comment")) == NULL) return 0; in init_identifiers()
1165 if (PyObject_SetAttr(state->FunctionDef_type, state->type_comment, Py_None) in init_types()
1176 if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->type_comment, in init_types()
1197 if (PyObject_SetAttr(state->Assign_type, state->type_comment, Py_None) == in init_types()
1213 if (PyObject_SetAttr(state->For_type, state->type_comment, Py_None) == -1) in init_types()
1219 if (PyObject_SetAttr(state->AsyncFor_type, state->type_comment, Py_None) == in init_types()
1233 if (PyObject_SetAttr(state->With_type, state->type_comment, Py_None) == -1) in init_types()
1239 if (PyObject_SetAttr(state->AsyncWith_type, state->type_comment, Py_None) in init_types()
1726 if (PyObject_SetAttr(state->arg_type, state->type_comment, Py_None) == -1) in init_types()
[all …]
/third_party/python/Doc/library/
Dast.rst741 .. class:: Assign(targets, value, type_comment)
749 .. attribute:: type_comment
751 ``type_comment`` is an optional string with the type annotation as a comment.
1028 .. class:: For(target, iter, body, orelse, type_comment)
1036 .. attribute:: type_comment
1038 ``type_comment`` is an optional string with the type annotation as a comment.
1204 .. class:: With(items, body, type_comment)
1209 .. attribute:: type_comment
1211 ``type_comment`` is an optional string with the type annotation as a comment.
1619 .. class:: FunctionDef(name, args, body, decorator_list, returns, type_comment)
[all …]
/third_party/python/Lib/
Dast.py789 comment = self._type_ignores.get(node.lineno) or node.type_comment
864 if type_comment := self.get_type_comment(node):
865 self.write(type_comment)