[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-26 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this one now. Thanks Serhiy and Inada-san! -- nosy: +yselivanov resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-25 Thread INADA Naoki
INADA Naoki added the comment: New changeset e76daebc0c8afa3981a4c5a8b54537f756e805de by INADA Naoki in branch 'master': bpo-32571: Fix reading uninitialized memory (GH-5332) https://github.com/python/cpython/commit/e76daebc0c8afa3981a4c5a8b54537f756e805de -- ___

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-25 Thread INADA Naoki
Change by INADA Naoki : -- pull_requests: +5178 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-25 Thread INADA Naoki
INADA Naoki added the comment: New changeset f320be77ffb73e3b9e7fc98c37b8df3975d84b40 by INADA Naoki (Serhiy Storchaka) in branch 'master': bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222) https://github.com/python/cpython/commit/f320be77ffb73e3b9e7fc98c3

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-17 Thread Nathaniel Smith
Nathaniel Smith added the comment: Well, mostly I just want to draw your attention to that use case to encourage you to make it public when it's ready :-) -- ___ Python tracker __

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because this API is experimental. It was changed in recent 24 hours and may be changed more before merging or even after releasing 3.7. -- ___ Python tracker _

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 5222 provides functions _PyObject_LookupAttr() and _PyObject_LookupAttrId() with alternate interface. Some code becomes even more simpler. The possible drawback of this approach is that the compiler should allocate the variable for the result on the stac

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5073 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-17 Thread Nathaniel Smith
Nathaniel Smith added the comment: Can I ask why this is a private API? It's extremely useful for extension modules too. For example, numpy has been carrying around a reimplementation of PyObject_GetAttr for years, exactly to avoid the cost of creating an AttributeError exception in common ca

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +5059 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In issue32544 there was introduced a new private C API function _PyObject_GetAttrWithoutError() which never raises an AttributeError, but returns NULL without error set if an attribute is absent. This allowed to speed up Python builtins hasattr() and geta