[issue39865] getattr silences an unrelated AttributeError

2020-04-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am going to mark this as closed for the reasons listed above. If another coredev wants to champion this, feel free to resurrect the issue. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue39865] getattr silences an unrelated AttributeError

2020-04-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: My instincts are to leave this alone and not gum up heavily trafficked core business logic. I don't like the external calls, the extra increfs and decrefs (and possible rentrancy issues), performance impact, or the pattern of holding the exception

[issue39865] getattr silences an unrelated AttributeError

2020-04-02 Thread Ammar Askar
Ammar Askar added the comment: Update: opened up https://github.com/python/cpython/pull/19303 as a quick first pass at implementing this. It works as expected and retains the context from the original exception just in case it's needed. The code isn't too pretty, looks like exception

[issue39865] getattr silences an unrelated AttributeError

2020-04-02 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +18665 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19303 ___ Python tracker ___

[issue39865] getattr silences an unrelated AttributeError

2020-03-31 Thread Ammar Askar
Ammar Askar added the comment: As unfortunate as this is, I don't think there's an easy way to solve this while adhering to descriptors and the attribute lookup model. This is a consequence of the following rule: > object.__getattr__(self, name): > Called when the default attribute access

[issue39865] getattr silences an unrelated AttributeError

2020-03-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39865] getattr silences an unrelated AttributeError

2020-03-05 Thread pasenor
New submission from pasenor : if a class has a descriptor and a defined __getattr__ method, and an AttributeError (unrelated to the descriptor lookup) is raised inside the descriptor, it will be silenced: class A: @property def myprop(self): print("property called") a