Open USSX-Hares opened 2 years ago
I've found that pyhocon's implementation of the operator +=
diverges from the HOCON standard: in HOCON, +=
(1) can only be applied to arrays and (2) can only append elements to arrays, not extend arrays with the arrays.
According to https://hocon-playground.herokuapp.com/, the following configuration:
d {
x = [1,2]
x += [3,4]
}
resolves into the following:
d {
x=[
1,
2,
[
3,
4
]
]
}
@darthbear, what do you think?
Root Casuse
Actually, the
+=
operator took the HOCON definition too literally. When thex += y
was met, it created a substitution forx
. Then, when the entire config is read, that substitution is applied at the exact namex
. However, ifx
was inside a dict object, thex
would not be resolved.Changes
+=
operator now creates a smarter substitutionToDo:
+=
in-place?