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

Support attribute access from other modules #6334

Merged
merged 7 commits into from Jan 20, 2021

Conversation

farahhariri
Copy link

@farahhariri farahhariri commented Oct 9, 2020

Accessing an attribute from another module currently fails if it has a complex data type like string. This PR passes the builder object to the get_getattr function and uses get_constant_generic instead of get_constant to retrieve attributes. A test case that shows an example that would usually fail and this PR fixes is added

@esc
Copy link
Member

esc commented Oct 13, 2020

@farahhariri thanks for submitting this! Perhaps you could provide a little more context as to why this is needed or what it fixes? Thanks!

@esc esc added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Oct 13, 2020
@farahhariri
Copy link
Author

@farahhariri thanks for submitting this! Perhaps you could provide a little more context as to why this is needed or what it fixes? Thanks!

Hi @esc This is needed for when someone accesses an attribute (like a constant tuple) in another module. I will add a test case to it to show what it addresses

@esc
Copy link
Member

esc commented Oct 16, 2020

@farahhariri excellent, test cases are always welcome.

@stuartarchibald stuartarchibald added this to the PR Backlog milestone Oct 21, 2020
@farahhariri farahhariri changed the title [WIP] pass in the builder with get_attr Support attribute access from other modules Jan 18, 2021
Copy link
Collaborator

@ehsantn ehsantn left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks.

Copy link
Member

@sklam sklam left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.

@sklam sklam modified the milestones: PR Backlog, Numba 0.53 RC Jan 20, 2021
@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on author Waiting for author to respond to review labels Jan 20, 2021
sklam added a commit to sklam/numba that referenced this pull request Jan 20, 2021
@sklam sklam mentioned this pull request Jan 20, 2021
@stuartarchibald
Copy link
Contributor

@farahhariri Congratulations on your first contribution to Numba!

@sklam sklam merged commit cea18fc into numba:master Jan 20, 2021
@farahhariri
Copy link
Author

@farahhariri Congratulations on your first contribution to Numba!

Thanks @stuartarchibald :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants