Repository navigation
Commit 616381f
Use isinstance for subclass safety and unify path helpers
Switch iterators.py and path.py from exact type checks (type(x) is dict)
to isinstance, so dict/list subclasses like ruamel.yaml's CommentedMap
and CommentedSeq are handled correctly. The ~5ns/call overhead is
negligible now that resolution is O(N) via structural sharing.
Unify path_get/_path_get_abc and path_set/_path_set_abc into shared
_step_get/_step_set_descend/_step_set_final helpers that handle both
concrete types and ABC fallback in one call chain, eliminating the
duplicated traversal and error-handling logic.
Expand resolver.py module docstring to document structural sharing
trade-offs: what's safe by default, what requires care, and the two
mitigation strategies (materialize=True, copy-on-write).
Co-authored-by: Cursor AI <[email protected]>
Co-authored-by: Anthropic Claude Opus 4.6 <[email protected]>1 parent 3810190 commit 616381f
3 files changed
Lines changed: 223 additions & 175 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
0 commit comments