You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/24 15:02:20 UTC

[GitHub] [incubator-superset] sturmer commented on a change in pull request #7403: [WIP] #5791: Address errors found by lgtm.com

sturmer commented on a change in pull request #7403: [WIP] #5791: Address errors found by lgtm.com
URL: https://github.com/apache/incubator-superset/pull/7403#discussion_r287399656
 
 

 ##########
 File path: superset/utils/core.py
 ##########
 @@ -126,9 +126,13 @@ def __repr__(self):
         """Return the function's docstring."""
         return self.func.__doc__
 
+    def __copy__(self):
+        return _memoized(self.func, self.watch)
+
     def __get__(self, obj, objtype):
         if not self.is_method:
-            self.is_method = True
+            copy = self.__copy__()
+            return functools.partial(copy.__call__, obj)
 
 Review comment:
   On further thought I think that the code uses this pattern to actually achieve the desired result. What I propose, in this case, is to either silence the alert with `# lgtm[py/mutable-descriptor]`, or to just ignore it. Maybe a comment in the code would be enough?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org