Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Comb] Update Python binding decorators to wrap in the right order. (#…
…6377) With a recent change upstream to the new `register_operation` decorators, we accidentally broke the Python class hierarchy for comb ops. Before this change, we would wrap the class generated by `register_operation`. This meant the added `create` methods were present on those classes, but when an operation was returned via Python bindings methods, it would not be a subclass of our final wrapped class; it would be the class returned by `register_operation`, and `isinstance` would not work as expected. With this change, we first wrap the class with our decorator, then wrap it with `register_operation`. This way, when operations are returned from the Python bindings, the returned operation is a subclass of our final wrapped class, and `isinstance` works as expected. A somewhat hacky but thorough test is added that demonstrates this issue, and confirms the new decorator order is working as expected.
- Loading branch information