Skip to content

Conversation

spyoungtech
Copy link
Contributor

@spyoungtech spyoungtech commented Apr 14, 2020

This change adds the __dir__ magic method to the RESTObject 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 call dir(obj) (or obj? 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 about dir() 😮

This change does make sense! Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy