2016-01-25 23:26:17 |
Joshua Harlow |
description |
So the usage of @trace_cls has various issues.
1. It doesn't work with subclassing correctly.
If u check out https://review.openstack.org/272314 and run https://gist.github.com/harlowja/851679cc5f513aa54a94 you will see that the A class now has the traces of B, even though A should not be affected by B.
2. It doesn't work when stacked, if multiple @trace_cls are done, then this will generate some weird crap/hierarchy of decorators that will be traced (this is also related to subclassing).
3. If a subclass uses different arguments to @trace_cls, differing from what its parent used, the subclass @trace_cls settings will override its parents, and weird crap will come out.
The traced meta class may also be affected by some of the above... |
So the usage of @trace_cls has various issues.
1. It doesn't work with subclassing correctly.
If u check out https://review.openstack.org/272314 and run https://gist.github.com/harlowja/851679cc5f513aa54a94 you will see that the A class now has the traces of B, even though A should not be affected by B.
2. It doesn't work when stacked, if multiple @trace_cls are done, then this will generate some weird crap/hierarchy of decorators that will be traced (this is also related to subclassing).
3. If a subclass uses different arguments to @trace_cls, differing from what its parent used, the subclass @trace_cls settings will overwrite its parents, and weird crap will come out.
The traced meta class may also be affected by some of the above... |
|