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

Named tuple support #331

Merged
merged 8 commits into from
Oct 23, 2024
Merged

Named tuple support #331

merged 8 commits into from
Oct 23, 2024

Commits on Oct 21, 2024

  1. feat: Named tuples

    tristanmenzel authored and achidlow committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    c02c518 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ce0c83 View commit details
    Browse the repository at this point in the history
  3. chore: Code cleanup

    tristanmenzel authored and achidlow committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    1548101 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3c5f3e1 View commit details
    Browse the repository at this point in the history
  5. chore: Lint fix

    tristanmenzel authored and achidlow committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    1a222fb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    407c59b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f59228f View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2024

  1. - create separate pytype for ARC4Tuple (in future probably want to do…

    … the same for structs)
    
    - introduce pytypes.TupleLikeType that captures both native and ARC4Tuples
    - make a NamedTupleType subclass of TupleType that exposes a `fields` property which is easier to create & consume
    - use NamedTuple for pre-compiled data structures
    - correct implicit arc4 conversion to use iterate_static, which also ensure single evaluation
    - introduce pytype for NamedTupleBaseType - this is somewhat of a lie, since typing.NamedTuple is not actually part of MRO at runtime due to Python magic, but it's a good lie because it allows resolving expression and type builders for NamedTuple without any hackery
    - fixing some error messages to start with lower case
    - expose concrete types on WType and PyType classes, this simplifies some things and Sequence/Mapping was mostly used as shorthand
    - add some negative tests for NamedTuple scenarios
    - general refactoring of new NamedTuple feature
    achidlow committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    8a9d495 View commit details
    Browse the repository at this point in the history