[issue41991] Remove _PyObject_HasAttrId

2020-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Remark: the issue that you give in this issue is helpful. Next time, you may 
include such rationale directly in the commit message. IMO the Linux kernel is 
a great example on how commit message should be written: long commit message 
with tons of information, you don't need to go to an online website (like 
bugs.python.org) to get more context / the rationale.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41991] Remove _PyObject_HasAttrId

2020-10-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41991] Remove _PyObject_HasAttrId

2020-10-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 98c4433a81a4cd88c7438adbee1f2aa486188ca3 by Serhiy Storchaka in 
branch 'master':
bpo-41991: Remove _PyObject_HasAttrId (GH-22629)
https://github.com/python/cpython/commit/98c4433a81a4cd88c7438adbee1f2aa486188ca3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41991] Remove _PyObject_HasAttrId

2020-10-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This function was kept after previous clean because all its usages was in the 
code which silences all exceptions in any case, so using _PyObject_HasAttrId 
did not do additional harm. But now it is used also in the new code in 
Objects/unionobject.c. It is safer to not only fix Objects/unionobject.c, but 
remove _PyObject_HasAttrId at all.

--
nosy: +pablogsal, vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41991] Remove _PyObject_HasAttrId

2020-10-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +21606
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22629

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41991] Remove _PyObject_HasAttrId

2020-10-10 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

_PyObject_HasAttrId() can return -1, 0 or 1. It returns -1 when cannot create a 
string (most likely due to MemoryError or UnicodeDecodeError), but returns 0 
and silences all exceptions raised when look up the attribute (including 
MemoryError, KeybordInterruptError and RecursionError). Silencing arbitrary 
exceptions is bad, and the interface of the function is inconsistent, so it is 
better to remove it and replace all 5 of its occurrences in 3 files with 
_PyObject_LookupAttrId(). It is private API, so we can do it without breaking 
user code.

--
components: Interpreter Core
messages: 378370
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove _PyObject_HasAttrId
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com