Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling dir() on a Structure includes Fields #42

Merged
merged 2 commits into from
Oct 7, 2016
Merged

Calling dir() on a Structure includes Fields #42

merged 2 commits into from
Oct 7, 2016

Conversation

rtzoeller
Copy link
Contributor

Based on this blogpost, it may be desirable to have Structure implement __dir__, and add the dynamic fields to the returned list. This promotes field discovery when not looking at the structure implementation, and may help improve autocomplete in some cases.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 98.529% when pulling 12202ba on rtzoeller:dir_support into 1912bca on digidotcom:master.

@posborne
Copy link
Contributor

posborne commented Oct 6, 2016

Can you add a simple test to ensure that this functionality does not regress in the future?

@rtzoeller
Copy link
Contributor Author

Realized this implementation is broken on Python2, as object does not provide a __dir__ method. Looking at alternative solutions.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 98.586% when pulling 7c915fb on rtzoeller:dir_support into 1912bca on digidotcom:master.

@posborne posborne merged commit 081c93d into digidotcom:master Oct 7, 2016
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.

3 participants