-
Lele Gaifax authored
As explained by the requester in issue #150, the first draft implementation wasn't up to the task, because it was based on a offhand logic. Now it is simpler and should cover all requester's cases. This folds into the new mapping_mode options the old "skip invalid keys" and "sort keys", respectively as MM_SKIP_NON_STRING_KEYS and MM_SORT_KEYS, but retains full backward compatibility. The patch is bigger than that, because I could not resist to cleanup and fix old choices I made in the past: although C++ compilers swallowed it, using enums for bitset values wasn't semantically correct, so I replaced every usage with plain unsigned ints. While there I factored out the common code used by several functions to evaluate and check the arguments coming from Python.
Lele Gaifax authoredAs explained by the requester in issue #150, the first draft implementation wasn't up to the task, because it was based on a offhand logic. Now it is simpler and should cover all requester's cases. This folds into the new mapping_mode options the old "skip invalid keys" and "sort keys", respectively as MM_SKIP_NON_STRING_KEYS and MM_SORT_KEYS, but retains full backward compatibility. The patch is bigger than that, because I could not resist to cleanup and fix old choices I made in the past: although C++ compilers swallowed it, using enums for bitset values wasn't semantically correct, so I replaced every usage with plain unsigned ints. While there I factored out the common code used by several functions to evaluate and check the arguments coming from Python.