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:
[email protected]


With regards,
Apache Git Services

Reply via email to