:param var: that's the original object we're dealing with. :param attribute: that's the key to resolve -- either the dict key in get_dictionary or the name in the dap protocol.
(self, var, attribute)
| 454 | |
| 455 | class TupleResolver: # to enumerate tuples and lists |
| 456 | def resolve(self, var, attribute): |
| 457 | """ |
| 458 | :param var: that's the original object we're dealing with. |
| 459 | :param attribute: that's the key to resolve |
| 460 | -- either the dict key in get_dictionary or the name in the dap protocol. |
| 461 | """ |
| 462 | if attribute in (GENERATED_LEN_ATTR_NAME, TOO_LARGE_ATTR): |
| 463 | return None |
| 464 | try: |
| 465 | return var[int(attribute)] |
| 466 | except: |
| 467 | if attribute == "more": |
| 468 | return MoreItems(var, pydevd_constants.PYDEVD_CONTAINER_INITIAL_EXPANDED_ITEMS) |
| 469 | |
| 470 | return getattr(var, attribute) |
| 471 | |
| 472 | def get_contents_debug_adapter_protocol(self, lst, fmt=None): |
| 473 | """ |