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

Fix trait selection by metadata #1474

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

mdickinson
Copy link
Member

PR #1469 made accessing nonexistent double-underscore-named attributes on a cTrait instance an AttributeError. Unfortunately, Envisage uses a metadata attribute __extension_point__ to identify extension points, and the filtering facilities of HasTraits.traits and HasTraits.class_traits fail as a result.

This PR fixes calls like hastraits_obj.traits(__extension_point=True__) and hastraits_obj.class_traits(__extension_point__=True) so that they no longer fail with an AttributeError.

Motivated by enthought/envisage#430, but may not fix it completely.

@mdickinson
Copy link
Member Author

Motivated by enthought/envisage#430, but may not fix it completely.

From testing, it looks as though this does fix enthought/envisage#430 completely.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Looks like you beat me to it. I was almost done making a PR when I saw your comment on the envisage issue :D

@rahulporuri
Copy link
Contributor

From testing, it looks as though this does fix enthought/envisage#430 completely.

It does. I too have tested this fix locally and I don't see the test failures observed in the issue

@mdickinson mdickinson merged commit f087c6d into master Jun 22, 2021
@mdickinson mdickinson deleted the fix/traits-and-class-traits-for-dunder-metadata branch June 22, 2021 09:21
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