eea / odfpy

API for OpenDocument in Python
GNU General Public License v2.0
308 stars 63 forks source link

Element.namespaces shouldn't be a class variable #67

Open regebro opened 6 years ago

regebro commented 6 years ago

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.