[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue26767 looks too complex and resolving it needs much more rewriting. -- resolution: remind -> fixed status: open -> closed ___ Python tracker

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset e5149789e4ea by Serhiy Storchaka in branch 'default': Issue #26745: Removed redundant code in _PyObject_GenericSetAttrWithDict. https://hg.python.org/cpython/rev/e5149789e4ea -- nosy: +python-dev ___

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'll defer committing the patch until some progress in issue26767 will be reached. May be _PyObject_GenericSetAttrWithDict() will have to rewrite again. -- assignee: -> serhiy.storchaka priority: normal -> low resolution: -> remind stage: patch

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-15 Thread Martin Panter
Martin Panter added the comment: Serhiy’s version looks good to me -- ___ Python tracker ___ ___

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-15 Thread Xiang Zhang
Xiang Zhang added the comment: It's a better work. And the code looks simpler now. I test it with the test suite and none fails (though some tests are skipped due to platform). -- ___ Python tracker

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But there are other redundant code in _PyObject_GenericSetAttrWithDict(). Here is a patch that makes larger refactoring. -- type: -> enhancement Added file: http://bugs.python.org/file42467/_PyObject_GenericSetAttrWithDict_2.patch

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-14 Thread Martin Panter
Martin Panter added the comment: This code mirrors code in the Get function, but that function inspects tp_descr_get (not set) instead. As I understand it, this is the difference between “data” descriptors and “non-data” descriptors. So I think the change is okay. -- nosy:

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: LGTM. Had to check the definition of PyDescr_IsData to determine that checking the value from tp_descr_set for NULL was exactly what that macro does, but yeah, it looks like the first test was redundant, and f is never assigned outside that block, so the

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-12 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +benjamin.peterson, pitrou ___ Python tracker ___ ___

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-12 Thread Xiang Zhang
New submission from Xiang Zhang: It seems some code in _PyObject_GenericSetAttrWithDict is not necessary. There is no need to check data descriptor again using PyDescr_IsData. And the second if (f != NULL) {} will never function. -- components: Interpreter Core files: