(self, n: ast3.Subscript)
| 2099 | |
| 2100 | # Subscript(expr value, expr slice, expr_context ctx) |
| 2101 | def visit_Subscript(self, n: ast3.Subscript) -> Type: |
| 2102 | empty_tuple_index = False |
| 2103 | if isinstance(n.slice, ast3.Tuple): |
| 2104 | params = self.translate_expr_list(n.slice.elts) |
| 2105 | if len(n.slice.elts) == 0: |
| 2106 | empty_tuple_index = True |
| 2107 | else: |
| 2108 | params = [self.visit(n.slice)] |
| 2109 | |
| 2110 | value = self.visit(n.value) |
| 2111 | if isinstance(value, UnboundType) and not value.args: |
| 2112 | result = UnboundType( |
| 2113 | value.name, |
| 2114 | params, |
| 2115 | line=self.line, |
| 2116 | column=value.column, |
| 2117 | empty_tuple_index=empty_tuple_index, |
| 2118 | ) |
| 2119 | result.end_column = n.end_col_offset |
| 2120 | result.end_line = n.end_lineno |
| 2121 | return result |
| 2122 | else: |
| 2123 | return self.invalid_type(n) |
| 2124 | |
| 2125 | def visit_Tuple(self, n: ast3.Tuple) -> Type: |
| 2126 | return TupleType( |
nothing calls this directly
no test coverage detected