You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/12 18:15:14 UTC

[GitHub] szha commented on a change in pull request #12811: Fixed __setattr__ method of _MXClassPropertyMetaClass

szha commented on a change in pull request #12811: Fixed __setattr__ method of _MXClassPropertyMetaClass
URL: https://github.com/apache/incubator-mxnet/pull/12811#discussion_r224873949
 
 

 ##########
 File path: python/mxnet/base.py
 ##########
 @@ -167,8 +167,8 @@ class _MXClassPropertyMetaClass(type):
     def __setattr__(cls, key, value):
         if key in cls.__dict__:
             obj = cls.__dict__.get(key)
-        if obj and isinstance(obj, _MXClassPropertyDescriptor):
-            return obj.__set__(cls, value)
+            if obj and isinstance(obj, _MXClassPropertyDescriptor):
+                return obj.__set__(cls, value)
 
 Review comment:
   Seems cleaner to just do
   ```python
   obj = cls.__dict__.get(key)
   if obj and isinstance(obj, _MXClassPropertyDescriptor):
       return obj.__set__(cls, value)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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