-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Ensure constant attribute is inherited #1017
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1017 +/- ##
=======================================
Coverage 87.25% 87.26%
=======================================
Files 9 9
Lines 4928 4930 +2
=======================================
+ Hits 4300 4302 +2
Misses 628 628 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see this one caught! I think that was my oversight orginally. Sorry about that!
if constant is True or readonly is True: # readonly => constant | ||
self.constant = True | ||
else: | ||
self.constant = constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh; good catch! I wonder if there were any other cases where it wouldn't inherit properly due to computation like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there were any other cases where it wouldn't inherit properly due to computation like this.
Good question 🙃 !
Any dependency between Parameter attributes (looking at you |
That's true.
But then we'd have to wonder what it means for constant=False and readonly=True, which seems like a bizarre case to even consider. Maybe it would have been best to handle that on attribute access, not via defaults? |
I think I could live with that as
I don't know and don't want to think about it too much :D EDIT: Coming back to the first point, |
Fixes #1001
Let's have a good look at the downstream tests before releasing 2.3.0, this is a nasty bug.