Skip to content

Conversation

atait
Copy link
Collaborator

@atait atait commented Oct 22, 2020

Unroll

Support for zip, enumerate, and dict.items() such as

for k, v in mydict.items():
    yield k
    yield v

Deindex

Sanitizing dict keys, such as in {'strange-key?!': 1, (1, 'x'): 2}

Collapse literals

Can resolve dictionaries if the keys can be made literal. Non-primitive values are allowed but remain AST.

This does not affect current behavior of pragma.collapse_literals unless the collapse_iterables argument is True. Mainly, this is used in cases where we are iterating over dictionary values or items.

@ghost
Copy link

ghost commented Oct 22, 2020

Congratulations 🎉. DeepCode analyzed your code in 2.652 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@coveralls
Copy link

coveralls commented Oct 22, 2020

Pull Request Test Coverage Report for Build 127

  • 50 of 62 (80.65%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.3%) to 86.039%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pragma/unroll.py 9 10 90.0%
pragma/core/resolve/literal.py 12 14 85.71%
pragma/deindex.py 15 18 83.33%
pragma/core/resolve/iterable.py 12 18 66.67%
Files with Coverage Reduction New Missed Lines %
pragma/lift.py 1 94.02%
pragma/core/resolve/init.py 2 78.0%
Totals Coverage Status
Change from base Build 112: -0.3%
Covered Lines: 1134
Relevant Lines: 1318

💛 - Coveralls

atait added 7 commits December 8, 2020 01:39
fix bug to put renamed deindex variable in scope
Nonliteral dicts and zips

deindex sanitizes special dict keys, as long as they are immutable
If v=[4] then deindex( v[0] ) -> v_0 -> 4 all in one go
@atait atait force-pushed the feature/compound-iteration-targets branch from b92fc02 to 2dde087 Compare December 8, 2020 08:43
@atait atait merged commit 28965da into develop Dec 8, 2020
@atait atait deleted the feature/compound-iteration-targets branch December 8, 2020 09:25
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