[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-28 Thread Ethan Furman
Ethan Furman added the comment: Note for posterity: the current behavior of __getattr__ is what allows Enum to work correctly. -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-19 Thread R. David Murray
R. David Murray added the comment: The more detailed discussion should happen on python-ideas. I'm going to close this for now, but if there's a consensus there about what action to take this issue could be reopened. (Or a new one created, whatever makes the most sense at that time.) --

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-19 Thread Jun Wang
Jun Wang added the comment: I think this is a common problem while using both __getattr__ and descriptor/property. A descriptor example: class Descriptor(): def __get__(self, instance, owner=None): raise AttributeError('Implicitly suppressed') class A(): d =

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-16 Thread R. David Murray
R. David Murray added the comment: I understand what you are concerned about, but unfortunately that would be a significant backward compatibility break. This would need discussion on python-ideas, I think. Even aside from the backward compatibility issue I have a feeling the additional comp

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-16 Thread Jun Wang
New submission from Jun Wang: See this simple example: class A(): def __init__(self, x=None): self.x = x @property def t(self): return self.x.t def __getattr__(self, name): return 'default' print(A().t) Attr