(self, n: ast3.Dict)
| 2132 | ) |
| 2133 | |
| 2134 | def visit_Dict(self, n: ast3.Dict) -> Type: |
| 2135 | if not n.keys: |
| 2136 | return self.invalid_type(n) |
| 2137 | items: dict[str, Type] = {} |
| 2138 | extra_items_from = [] |
| 2139 | for item_name, value in zip(n.keys, n.values): |
| 2140 | if not isinstance(item_name, ast3.Constant) or not isinstance(item_name.value, str): |
| 2141 | if item_name is None: |
| 2142 | extra_items_from.append(self.visit(value)) |
| 2143 | continue |
| 2144 | return self.invalid_type(n) |
| 2145 | items[item_name.value] = self.visit(value) |
| 2146 | result = TypedDictType(items, set(), set(), _dummy_fallback, n.lineno, n.col_offset) |
| 2147 | result.extra_items_from = extra_items_from |
| 2148 | return result |
| 2149 | |
| 2150 | # Attribute(expr value, identifier attr, expr_context ctx) |
| 2151 | def visit_Attribute(self, n: Attribute) -> Type: |
nothing calls this directly
no test coverage detected