Commit 58c0869
Refactor: Simplify IniConfig constructor and parse() method
Consolidate __init__ to accept optional _sections and _sources parameters,
allowing parse() to simply call the constructor.
Changes:
- Add _sections and _sources optional parameters to __init__
- Compute sections and sources first, then assign once to Final attributes
- When pre-parsed data provided, use it directly (called from parse())
- Otherwise, parse the data normally (backward compatible path)
- Simplify parse() to just call constructor with pre-parsed data
This makes the code cleaner and easier to understand while maintaining
the exact same functionality and backward compatibility.
All 49 tests pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6d0af45 commit 58c0869
1 file changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
109 | 120 | | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 177 | + | |
| 178 | + | |
171 | 179 | | |
172 | 180 | | |
173 | 181 | | |
| |||
0 commit comments