Skip to content

Fix #7394 and #6550 & Added test & improved error message - #7395

Merged
sklam merged 3 commits into
numba:masterfrom
MegaIng:comprehension_iter
Nov 1, 2021
Merged

sklam merged 3 commits into
numba:masterfrom
MegaIng:comprehension_iter

Conversation

@MegaIng

@MegaIng MegaIng commented Sep 10, 2021

Copy link
Copy Markdown
Contributor

also renames range_iter_len -> comprehension_iter_len

As discussed with @stuartarchibald, this adds the code he suggest in both the issues to (the renamed) comprehension_iter_len and gives a better error message. It might be worth considering to move comprehension_iter_len to another module, since it is now even less tightly coupled to the rangeobj.

also renames range_iter_len -> comprehension_iter_len
@stuartarchibald

Copy link
Copy Markdown
Contributor

Thanks for the patch @MegaIng.

As this contains my patch from #7394 (comment) please could one of you take a look at this @esc @sklam @gmarkall ? Thanks!

@stuartarchibald

Copy link
Copy Markdown
Contributor

also renames range_iter_len -> comprehension_iter_len

@MegaIng RE: the above, I've left some comments here on the original issue: #7394 (comment)

@stuartarchibald stuartarchibald added this to the Numba 0.55 RC milestone Sep 10, 2021

@sklam sklam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one flake8 nitpick

Comment thread numba/core/inline_closurecall.py Outdated
@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Sep 10, 2021
@MegaIng
MegaIng requested a review from sklam September 14, 2021 18:34
@stuartarchibald stuartarchibald added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Sep 15, 2021
Comment thread numba/cpython/rangeobj.py
stmts.append(_new_definition(func_ir, len_func_var,
ir.Global('range_iter_len', range_iter_len, loc=loc),
loc))
ir.Global('length_of_iterator',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm happy with this choice of name, thanks for altering it!

@stuartarchibald stuartarchibald added 4 - Waiting on author Waiting for author to respond to review and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Oct 12, 2021
@stuartarchibald

Copy link
Copy Markdown
Contributor

@sklam please could you re-check? This looks good to me but also contains code I wrote. Thanks.

@stuartarchibald stuartarchibald added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Oct 13, 2021

@sklam sklam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the patch!

@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Nov 1, 2021
@sklam
sklam merged commit 861ce4d into numba:master Nov 1, 2021
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 Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants