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

Python builder: Cannot change __class__ of the object type #39

Closed
wants to merge 1 commit into from

Conversation

longhotsummer
Copy link
Contributor

Fixes #30

@longhotsummer
Copy link
Contributor Author

This seems to happens when address is FAILURE.

@jcoglan
Copy link
Owner

jcoglan commented Aug 3, 2020

Hi @longhotsummer, thank you for taking a look at this. I think this specific check will be brittle, as the value subject to extension may be any user-supplied value, if they're using custom actions. Therefore checking that type(value) != object, which happens to be true for the FAILURE sentinel value, is too broad a check.

Instead we have the builder function ifNode_() specifically for this purpose, and I've made the Extension AST node use this, so it applies across all language backends -- see 5081a30.

See also my commend here #30 (comment) on another attempt at fixing this.

@jcoglan jcoglan closed this Aug 3, 2020
@jcoglan
Copy link
Owner

jcoglan commented Apr 1, 2022

This should now be fixed as part of the v0.4 release; see https://blog.jcoglan.com/2022/04/01/announcing-canopy-0-4/

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.

[python] adding methods to nodes fails with alternatives
2 participants