This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new fe2c4d8  Fixed __setattr__ method of _MXClassPropertyMetaClass (#12811)
fe2c4d8 is described below

commit fe2c4d8e8c77951afc9ab068e1279b3823a43d25
Author: Lorenzo Stella <[email protected]>
AuthorDate: Wed Oct 17 08:15:49 2018 +0200

    Fixed __setattr__ method of _MXClassPropertyMetaClass (#12811)
    
    * fixed indentation
    
    * simplified code
---
 python/mxnet/base.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/python/mxnet/base.py b/python/mxnet/base.py
index 84b9e58..7276c52 100644
--- a/python/mxnet/base.py
+++ b/python/mxnet/base.py
@@ -165,8 +165,7 @@ class _MXClassPropertyDescriptor(object):
 
 class _MXClassPropertyMetaClass(type):
     def __setattr__(cls, key, value):
-        if key in cls.__dict__:
-            obj = cls.__dict__.get(key)
+        obj = cls.__dict__.get(key)
         if obj and isinstance(obj, _MXClassPropertyDescriptor):
             return obj.__set__(cls, value)
 

Reply via email to