Element.namespaces is a class variable, which means all elements will have the same namespaces even across documents.
This means any document creation will change a global state, which is not only wrong, but makes it hard to test since tests rean't isolated.
The comment is "Due to shallow copy this is a static variable" which doesn't make sense to me, but a simple fix breaks some tests, and I don't know if that's because the tests are wrong or because this has sideeffects that we don't want.
Element.namespaces is a class variable, which means all elements will have the same namespaces even across documents.
This means any document creation will change a global state, which is not only wrong, but makes it hard to test since tests rean't isolated.
The comment is "Due to shallow copy this is a static variable" which doesn't make sense to me, but a simple fix breaks some tests, and I don't know if that's because the tests are wrong or because this has sideeffects that we don't want.