)]}'
{"osprofiler/profiler.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"b3cd2d45b74a0b59a77072e98939200b07aafca8","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                          methods that starts \"__\" even if it is turned on."},{"line_number":140,"context_line":"    \"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def decorator(cls):"},{"line_number":143,"context_line":"        mro_dicts \u003d [c.__dict__ for c in inspect.getmro(cls)]"},{"line_number":144,"context_line":"        for attr_name, attr in inspect.getmembers(cls):"},{"line_number":145,"context_line":"            if not (inspect.ismethod(attr) or inspect.isfunction(attr)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_e0d74421","line":142,"updated":"2016-01-21 23:39:44.000000000","message":"How does this avoid double tracing classes that have already had there methods decorated?\n\nSay I have a root class that uses this decorator, then a subclass, wouldn\u0027t the methods on it get double traced if both of those classes use this decorator?","commit_id":"e164b803a5f576a772ff54e746d887a7b7f0ad35"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"88def1c3522d2cc6bb1470e34f3a8c1c9746815c","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                          methods that starts \"__\" even if it is turned on."},{"line_number":140,"context_line":"    \"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def decorator(cls):"},{"line_number":143,"context_line":"        mro_dicts \u003d [c.__dict__ for c in inspect.getmro(cls)]"},{"line_number":144,"context_line":"        for attr_name, attr in inspect.getmembers(cls):"},{"line_number":145,"context_line":"            if not (inspect.ismethod(attr) or inspect.isfunction(attr)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_8ec2b251","line":142,"in_reply_to":"9a68dd71_743acc9a","updated":"2016-01-25 19:41:21.000000000","message":"Ya, except afaik u can\u0027t have two metaclasses so the usefulness of TracedMeta in existing code-bases doesn\u0027t seem to much. Anyways, something else to make better in the future.","commit_id":"e164b803a5f576a772ff54e746d887a7b7f0ad35"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"3b019cad4ab509e27276574ed090fed0393bafa5","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                          methods that starts \"__\" even if it is turned on."},{"line_number":140,"context_line":"    \"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def decorator(cls):"},{"line_number":143,"context_line":"        mro_dicts \u003d [c.__dict__ for c in inspect.getmro(cls)]"},{"line_number":144,"context_line":"        for attr_name, attr in inspect.getmembers(cls):"},{"line_number":145,"context_line":"            if not (inspect.ismethod(attr) or inspect.isfunction(attr)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_fccaed19","line":142,"in_reply_to":"9a68dd71_8ec2b251","updated":"2016-01-26 09:45:21.000000000","message":"Yeah, that was the reason for me creating the new metaclass in Nova inherited from PeriodicTasks and TracedMeta - https://review.openstack.org/#/c/254703/22/nova/manager.py - this approach works ok","commit_id":"e164b803a5f576a772ff54e746d887a7b7f0ad35"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"52ba15b218dc28fcb6ae4b90d818f93560fd5893","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                          methods that starts \"__\" even if it is turned on."},{"line_number":140,"context_line":"    \"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def decorator(cls):"},{"line_number":143,"context_line":"        mro_dicts \u003d [c.__dict__ for c in inspect.getmro(cls)]"},{"line_number":144,"context_line":"        for attr_name, attr in inspect.getmembers(cls):"},{"line_number":145,"context_line":"            if not (inspect.ismethod(attr) or inspect.isfunction(attr)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_743acc9a","line":142,"in_reply_to":"9a68dd71_e0d74421","updated":"2016-01-25 10:13:33.000000000","message":"this is not avoiding this issue, for this purpose TracedMeta metaclass should be used. trace_cls decorator is useful for just one class tracing with no parents/interesting children.\n\nThis change only fixes the issue, that when we\u0027re working with already create class object (not with descriptor, as it happens in case of metaclass usage) we need to use setattr with either static/class methods generated if the original method is static/class. In other case, setattr(cls, attr_name, wrapped_method) will simply modify the static/class method to just instancemethod, that requires self to be passed as a first arg, that\u0027s not true for original methods.","commit_id":"e164b803a5f576a772ff54e746d887a7b7f0ad35"}]}
