Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(types): add __dir__ to RESTObject to expose attributes#1072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intopython-gitlab:masterfromspyoungtech:feat/restobject-dir
Apr 14, 2020
Merged

feat(types): add __dir__ to RESTObject to expose attributes#1072

max-wittig merged 1 commit intopython-gitlab:masterfromspyoungtech:feat/restobject-dir
Apr 14, 2020

Conversation

spyoungtech
Copy link
Contributor

@spyoungtechspyoungtech commentedApr 14, 2020
edited
Loading

This change adds the__dir__ magic method to theRESTObject class in order to expose and allow introspection on the attributes that the object might have.

This is very useful to me when exploring the API in an interactive console.

Normally I'll calldir(obj) (orobj? in iPython shell) to try to discover what methods and attributes exist for the object. However, the attributes in the.attributes property are not currently exposed, requiring the extra step of checking.attributes on each object I explore this way.

Hope this makes sense and that this change, if accepted, will help others.

@max-wittig
Copy link
Member

Didn't even know aboutdir() 😮

This change does make sense! Thanks for your contribution!

spyoungtech reacted with rocket emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@spyoungtech@max-wittig

[8]ページ先頭

©2009-2025 Movatter.jp