-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make class variables immutable #187
Conversation
Codecov Report
@@ Coverage Diff @@
## main #187 +/- ##
==========================================
+ Coverage 98.63% 98.71% +0.08%
==========================================
Files 55 55
Lines 2047 2180 +133
==========================================
+ Hits 2019 2152 +133
Misses 28 28
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This should be done because if these were edited in one instance then it would change across all instances.
18fcf37
to
c6608be
Compare
@WilliamJamieson Would you help me reproduce the segfault? Testing locally with several asdf version and extensions within asdf, custom extensions and ones in asdf-astropy I've so far failed to produce a segfault by changing the types and tags to tuples. |
You are correct, it was an independent bug I introduced. |
Thanks for the follow up! |
An issue pointed out in #183 is that we have many of the classes which define mutable class variables. In general, mutable class variables should not be used because the state of that variable is shared across all instances. Thus they should be made to be immutable objects.
This PR corrects this issue for this package.
Note that this issue occurs mostly for the
tags
andtypes
attributes of the converters. These were turned into properties instead of tuples because ASDF does not support these values being anything other than lists (ASDF will literally segfault).