Repository navigation
Support for dict comprehension - #6736
Merged
Merged
Conversation
stuartarchibald
force-pushed
the
fix/5135
branch
from
February 19, 2021 14:04
ccad165 to
97e6143
Compare
As title. Closes: numba#5135
stuartarchibald
force-pushed
the
fix/5135
branch
from
February 19, 2021 14:09
97e6143 to
dcbe948
Compare
esc
requested changes
Feb 23, 2021
esc
left a comment
Member
There was a problem hiding this comment.
One suggestion to fix doc formatting and a question about test coverage.
Comment on lines
+808
to
+811
| In [2]: @njit | ||
| ...: def foo(n): | ||
| ...: return {i: i**2 for i in range(n)} | ||
| ...: |
Member
There was a problem hiding this comment.
Suggested change
| In [2]: @njit | |
| ...: def foo(n): | |
| ...: return {i: i**2 for i in range(n)} | |
| ...: | |
| In [2]: @njit | |
| ...: def foo(n): | |
| ...: return {i: i**2 for i in range(n)} | |
| ...: |
Contributor
Author
There was a problem hiding this comment.
well spotted, colons are lined up in 7145e6c
Member
There was a problem hiding this comment.
excellent, ready to smoketest then?
| info.append(inst, items=items[::-1], size=count, res=dct) | ||
| info.push(dct) | ||
|
|
||
| def op_MAP_ADD(self, info, inst): |
Member
There was a problem hiding this comment.
I tried to check if this code was ever exercised, by using the patch:
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'vals' of function 'TestDictObject.test_dict_values.<locals>.diff --git i/numba/core/byteflow.py w/numba/core/byteflow.py
index 5c612f3a08..bf7f48cf84 100644
--- i/numba/core/byteflow.py
+++ w/numba/core/byteflow.py
@@ -920,6 +920,8 @@ class TraceRunner(object):
# NOTE: https://docs.python.org/3/library/dis.html#opcode-MAP_ADD
# Python >= 3.8: TOS and TOS1 are value and key respectively
# Python < 3.8: TOS and TOS1 are key and value respectively
+ import ipdb
+ ipdb.set_trace()
TOS = state.pop()
TOS1 = state.pop()
key, value = (TOS, TOS1) if PYVERSION < (3, 8) else (TOS1, TOS)
diff --git i/numba/core/dataflow.py w/numba/core/dataflow.py
index c351086a50..646103e682 100644
--- i/numba/core/dataflow.py
+++ w/numba/core/dataflow.py
@@ -203,6 +203,8 @@ class DataFlowAnalysis(object):
info.push(dct)
def op_MAP_ADD(self, info, inst):
+ import ipdb
+ ipdb.set_trace()
key = info.pop()
value = info.pop()
index = inst.arg
But it never stopped in datalflow.py when executing the tests in this PR.
Member
There was a problem hiding this comment.
So, dataflow.py is for older Pythons.
Member
There was a problem hiding this comment.
Right, for python<3.7. I can't wait to drop py3.6.
As title
Member
|
Build farm ID: |
esc
approved these changes
Feb 23, 2021
Member
|
Smoketest was green, this is good to go in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As title.
Closes: #5135