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

WIP: Named attributes #15

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

atait
Copy link
Collaborator

@atait atait commented Oct 14, 2020

Follows #13

support for attribute access of user-defined classes

If it has the attribute and it is a literal, collapse the get attribute

Unrolling and deindexing namedtuple

Support for enumerate

Before, this only worked for sequences of literals. Now it can combine with deindexing of heterogeneous sequences. It must be in this order of decoration

@pragma.unroll
@pragma.deindex(v, 'v', collapse_iterables=True)        
def f():
    for i, elem in enumerate(v):
        yield i, elem

atait added 6 commits October 13, 2020 15:46
 - Works on any type of object so long as name, attribute, and result are literals
- notable case: namedtuples
fixes the messy merge
- so lists/tuples get to keep abc.Sequence semantics
- meaning enumerate is now supported
@ghost
Copy link

ghost commented Oct 14, 2020

DeepCode's analysis on #79fc9b found:

  • ℹ️ 1 minor issue. 👇

Top issues

Description Example fixes
Use % formatting in logging functions and pass the % parameters as arguments Occurrences: 🔧 Example fixes

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

@coveralls
Copy link

coveralls commented Oct 14, 2020

Pull Request Test Coverage Report for Build 116

  • 28 of 30 (93.33%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 86.568%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pragma/core/resolve/init.py 14 16 87.5%
Totals Coverage Status
Change from base Build 112: 0.3%
Covered Lines: 1115
Relevant Lines: 1288

💛 - Coveralls

@atait atait changed the title Named attributes WIP: Named attributes Dec 8, 2020
@atait atait changed the base branch from develop to master January 2, 2021 19:43
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