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
allow multiple instances of a Magic #1964
Conversation
the true magics table is now an *instance* attribute, rather than a *class* attribute, which was previously being clobbered with references to the first instance.
More than by design, it was by expedience in the rush of getting everything done. Definitely this needs a cleanup, I've already thought of other cases where the current implementation will give us headaches. |
Well, given all the cell magics people have been contributed, it's clearly highly valuable and great work. But it is pretty complex, so we are going to find little weird bugs like this while we are putting it through the ringer. |
mark this with |
oops, no - there should be two commits, test and fix. I just forgot to push the second :) |
Test results for commit 139d6c0 (can't merge cleanly)
Not available for testing: python3.1 |
Any reason this shouldn't be merged? It's relatively minor, so I would be okay letting it slip to after 0.13, but the side effects of the bug are quite surprising when they come up (as seen on-list). |
No, no reason, just too busy. I'd had a first look before and just didn't finish, sorry. This is a good fix for a wart from the cell magics work, so it should go in. Thanks for the good work! Merging now. |
allow multiple instances of a Magic by tracking all instances of any Magics subclass rather than having a mapping that only tracks the first instance.
allow multiple instances of a Magic by tracking all instances of any Magics subclass rather than having a mapping that only tracks the first instance.
as reported on-list, Magics were using a class magics mapping, bound to the first instance, rather than creating a mapping for each instance.
This may have been by design, but it offers little-to-no benefit, and surprising unchangeable behavior in (admittedly unlikely) cases.