You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-06-04.14:10:25.827>created_at=<Date2015-06-04.05:06:36.712>labels= ['invalid', 'type-bug', 'library']
title='dir(dictobject) returns empty list when __getattribute__ is overriden in the class'updated_at=<Date2015-06-04.14:10:25.792>user='https://bugs.python.org/alkayadavit07gmailcom'
When __getattribute__ method is overrriden in a class,then in case of calling
an attribute not in class object should throw KeyError.
But when calling dir on classs object gives an empty list as dir(dictobject)
calls dictobject.__getattribute__(dir) and it throws KeyError instead of AttributeError in dir annd it returns NULL upstream
So dir source code need to be fixed to catch KeyError appropriately.
If you override __getattribute__ it is your responsibility to fulfill its contract, so your method is the one that needs to catch the KeyError and return the expected AttributeError.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: