(self, other)
| 450 | return id(self) |
| 451 | |
| 452 | def __getitem__(self, other): |
| 453 | # Special case, to avoid stringifying references to class-scoped variables |
| 454 | # as '__classdict__["x"]'. |
| 455 | if self.__ast_node__ == "__classdict__": |
| 456 | raise KeyError |
| 457 | if isinstance(other, tuple): |
| 458 | extra_names = {} |
| 459 | elts = [] |
| 460 | for elt in other: |
| 461 | new_elt, new_extra_names = self.__convert_to_ast_getitem(elt) |
| 462 | if new_extra_names is not None: |
| 463 | extra_names.update(new_extra_names) |
| 464 | elts.append(new_elt) |
| 465 | other = ast.Tuple(elts) |
| 466 | else: |
| 467 | other, extra_names = self.__convert_to_ast_getitem(other) |
| 468 | assert isinstance(other, ast.AST), repr(other) |
| 469 | return self.__make_new(ast.Subscript(self.__get_ast(), other), extra_names) |
| 470 | |
| 471 | def __getattr__(self, attr): |
| 472 | return self.__make_new(ast.Attribute(self.__get_ast(), attr)) |
nothing calls this directly
no test coverage detected