Skip to content
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

Revert checking of abstract parameters in post init #3197

Merged
merged 4 commits into from
Jul 13, 2021

Conversation

jenshnielsen
Copy link
Collaborator

It turns out that this approach has unintended side effects when multiple inheritance is used. This will effectively generate init methods for any class that does not have an init method but inherits from something that has an init method. In multiple inheritance scenarios this may change the order in which init methods are called. See https://gist.github.com/jenshnielsen/c3f6457f3510d638722c58e1e163ddee for an example of how this can happen.

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #3197 (35a7c60) into master (c1c8270) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3197      +/-   ##
==========================================
- Coverage   65.93%   65.91%   -0.03%     
==========================================
  Files         218      218              
  Lines       28907    28888      -19     
==========================================
- Hits        19060    19041      -19     
  Misses       9847     9847              

@jenshnielsen jenshnielsen self-assigned this Jul 12, 2021
@jenshnielsen jenshnielsen added this to the 0.27.0 milestone Jul 12, 2021
@jenshnielsen jenshnielsen enabled auto-merge July 13, 2021 08:55
@jenshnielsen jenshnielsen merged commit 21caf8e into microsoft:master Jul 13, 2021
@jenshnielsen jenshnielsen deleted the revert_post_init branch December 17, 2021 15:23
bors bot added a commit that referenced this pull request Jan 8, 2022
3718: Reimplement abstract instrument r=jenshnielsen a=jenshnielsen

This is a start of re implementing the abstract parameter interface reverted in #3197 and #3217 based on top of #3696

Compared to the solution based on init subclass this works a bit differently. The metaclass in use is only implemented for the Instrument class but not for the InstrumentChannel. Changing this would require metaclass inheritance which is a bad idea. 
This meas that it is not an error to create an InstrumentChannel with abstract parameters but it is an error to attach such a thing to an instrument at instrument creation time. I don't think this is a big issue since that is how most instruments are created. 

Still need to update docs again and verify if there are other reverted changes to bring over 



Co-authored-by: Jens H. Nielsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants