)]}'
{"neutron_lib/callbacks/registry.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"35efc3ccc5eb98090236f679af76ad9f78cd2e7d","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @staticmethod"},{"line_number":89,"context_line":"    def replacement_new(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if new_inherited:"},{"line_number":91,"context_line":"            # class didn\u0027t define __new__ so we need to call inherited __new__"},{"line_number":92,"context_line":"            super_new \u003d super(klass, cls).__new__"},{"line_number":93,"context_line":"            if super_new is object.__new__:"},{"line_number":94,"context_line":"                # object.__new__ doesn\u0027t accept args nor kwargs"},{"line_number":95,"context_line":"                instance \u003d super_new(cls)"},{"line_number":96,"context_line":"            else:"},{"line_number":97,"context_line":"                instance \u003d super_new(cls, *args, **kwargs)"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            instance \u003d orig_new(cls, *args, **kwargs)"},{"line_number":100,"context_line":"        if getattr(instance, \u0027_DECORATED_METHODS_SUBSCRIBED\u0027, False):"},{"line_number":101,"context_line":"            # Avoid running this logic twice for classes inheriting other"},{"line_number":102,"context_line":"            # classes with this same decorator. Only one needs to execute"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_7c0a5a27","line":99,"range":{"start_line":90,"start_character":8,"end_line":99,"end_character":53},"updated":"2017-03-06 09:13:01.000000000","message":"One thing to note. We are moving the neutron code to neutron-lib.\nThis means we will lose the history and background of this code, and if time goes it will not be easy to track the original code.\n\nI believe it is worth adding some comment which describe the background. Having the review links would help us.\n\n  The logic below checks new_inherited and object.__new__.\n  For detail reasons, ses the following reviews:\n  https://review.openstack.org/#/c/439801/\n  https://review.openstack.org/#/c/439050/\n\n(This code was reviewed in neutron side and looks fine to me too.)","commit_id":"5bfdb3d4cd419ff369e95c0b7ee8f5afc5930692"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"35efc3ccc5eb98090236f679af76ad9f78cd2e7d","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            if (not inspect.ismethod(unbound_method) and"},{"line_number":107,"context_line":"                    not inspect.isfunction(unbound_method)):"},{"line_number":108,"context_line":"                continue"},{"line_number":109,"context_line":"            # handle py27/py34 difference"},{"line_number":110,"context_line":"            func \u003d getattr(unbound_method, \u0027im_func\u0027, unbound_method)"},{"line_number":111,"context_line":"            if func not in _REGISTERED_CLASS_METHODS:"},{"line_number":112,"context_line":"                continue"},{"line_number":113,"context_line":"            for resource, event in _REGISTERED_CLASS_METHODS[func]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba2be162_dcc98627","line":110,"range":{"start_line":109,"start_character":12,"end_line":110,"end_character":69},"updated":"2017-03-06 09:13:01.000000000","message":"I think it is better to use condition like \"if six.PY3\". It clarifies the logic.\n\n  func \u003d unbound_method if six.PY3 else getattr(unbound_method, \u0027im_func\u0027)","commit_id":"5bfdb3d4cd419ff369e95c0b7ee8f5afc5930692"}]}
