python-libconf icon indicating copy to clipboard operation
python-libconf copied to clipboard

Round-trip config editing

Open jalaziz opened this issue 6 years ago • 1 comments

This may be out of scope for this project, but it would be amazing if python-libconf could support round-trip editing of a config file. In particular, it would be great if comments and key orders are preserved.

jalaziz avatar Jan 29 '19 22:01 jalaziz

In my understanding, key orders will be preserved in Python 3.8+, since dict is now ordered by default.

Preserving comments is harder, since python-libconf returns JSON-like data structures (i.e. dicts/lists/tuples). It's not obvious how to include comments in such a data structure, without making the default use-case of "just reading libconfig files" less convenient.

Overall, such a feature seems so far removed from python-libconf's goals, that it's probably better off as a separate library.

ChrisAichinger avatar May 13 '21 08:05 ChrisAichinger