Commit 0fd572b
committed
fix(translation): make _bind_to_map pure and prevent double-wrapping
- Add copy.deepcopy to avoid mutating input params (side effect bug)
- Check for existing map_flag to prevent double-wrapping on repeated calls
- Handle edge cases for non-list/non-dict types (primitives, None)
- Import copy module at top of file
Fixes side effects bug where calling _bind_to_map multiple times would
mutate the original params and potentially double-wrap the map_flag.
Entire-Checkpoint: a0dbc5306a761 parent f50afef commit 0fd572b
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| 458 | + | |
| 459 | + | |
457 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
458 | 464 | | |
459 | 465 | | |
460 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
461 | 469 | | |
462 | | - | |
| 470 | + | |
463 | 471 | | |
464 | 472 | | |
465 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
466 | 480 | | |
467 | 481 | | |
468 | 482 | | |
| |||
0 commit comments