|
16 | 16 |
|
17 | 17 |
|
18 | 18 | _DEFAULT_SYNTAX_HL: Final[dict[str, tuple[str, str]]] = { |
19 | | - "str": (f"[br:blue]", "[_c]"), |
20 | | - "number": (f"[br:magenta]", "[_c]"), |
21 | | - "literal": (f"[magenta]", "[_c]"), |
22 | | - "type": (f"[i|green]", "[_i|_c]"), |
23 | | - "punctuation": (f"[br:black]", "[_c]"), |
| 19 | + "str": ("[br:blue]", "[_c]"), |
| 20 | + "number": ("[br:magenta]", "[_c]"), |
| 21 | + "literal": ("[magenta]", "[_c]"), |
| 22 | + "type": ("[i|green]", "[_i|_c]"), |
| 23 | + "punctuation": ("[br:black]", "[_c]"), |
24 | 24 | } |
25 | 25 | """Default syntax highlighting styles for data structure rendering.""" |
26 | 26 |
|
@@ -539,7 +539,8 @@ def _get_path_id(path: str, path_sep: str, data_obj: Any, ignore_not_found: bool |
539 | 539 | path_ids.append(str(idx)) |
540 | 540 | max_id_length = max(max_id_length, len(str(idx))) |
541 | 541 |
|
542 | | - if not path_ids: return None |
| 542 | + if not path_ids: |
| 543 | + return None |
543 | 544 | return f"{max_id_length}>{''.join(id.zfill(max_id_length) for id in path_ids)}" |
544 | 545 |
|
545 | 546 | @classmethod |
@@ -716,7 +717,8 @@ def should_expand(self, seq: IndexIterable) -> bool: |
716 | 717 | return False |
717 | 718 |
|
718 | 719 | complex_types: tuple[type, ...] = (list, tuple, dict, set, frozenset) |
719 | | - if self.as_json: complex_types += (bytes, bytearray) |
| 720 | + if self.as_json: |
| 721 | + complex_types += (bytes, bytearray) |
720 | 722 |
|
721 | 723 | complex_items = sum(1 for item in seq if isinstance(item, complex_types)) |
722 | 724 |
|
|
0 commit comments