Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

{Pairing, Authentication}Status.__getattr__ raises KeyError instead of AttributeError #32

Open
trdarr opened this issue Aug 5, 2014 · 0 comments

Comments

@trdarr
Copy link
Contributor

trdarr commented Aug 5, 2014

We use __getattr__ to make accessing the response data nicer, so __getattr__(self, name) returns self._raw_data[name]. However, if name isn’t in _raw_data, a KeyError will be raised. I think most Python programmers would expect an AttributeError. We should probably also support nested attributes, because auth_request.requester.id is way less pretty than auth_request.requester['id'].

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant