Hi @mhoffmann
Thanks for raising this, you’re absolutely right that variables with underscores like ivy.var.MY_VAR generally work and are supported.
The reason we introduced a warning is related to how variable resolution works internally. Underscores are also used by the API to separate namespaces, which can lead to ambiguity. For example, if you have a variable named MY_VAR and also a variable VAR inside a namespace MY, both would resolve to ivy.var.MY_VAR. In that situation, we can’t reliably determine which variable is meant.
So the warning is not about underscores being invalid, but about preventing these ambiguous cases.
That said, I agree that the current warning message is misleading because it suggests underscores are generally unsupported, which isn’t true.
We have improved this behavior so that a warning is no longer shown just because a variable contains an underscore. It now only appears if there is an actual ambiguity like the one described above and the message itself has been updated to better explain the situation.